Rank: Member
Groups: Member
Joined: 6/2/2006(UTC) Posts: 4
|
Hi
We have an ASP.Net page with a textbox that needs to have a value before the upload may occur.
Is there anyway to fire this validator before the upload occurs?
- Richard
|
|
|
|
Rank: Advanced Member
Groups: Member, Administration, Moderator Joined: 9/19/2006(UTC) Posts: 506
Was thanked: 41 time(s) in 41 post(s)
|
Hello, Try to use BeforeUpload event: Code:...
function ImageUploader1_BeforeUpload()
{
if (<ValueInTextbox>)
{
return true;
}
else
{
return false;
}
}
...
iu.addEventListener("BeforeUpload", "ImageUploader1_BeforeUpload");
...
Edited by user Tuesday, February 19, 2008 2:41:15 PM(UTC)
| Reason: Not specified |
Best regards, Eugene Kosmin The Aurigma Development Team
|
|
|
|
Rank: Member
Groups: Member
Joined: 6/2/2006(UTC) Posts: 4
|
That was perfect....thanks alot.
- Richard
|
|
|
|
Rank: Member
Groups: Member
Joined: 6/2/2006(UTC) Posts: 4
|
Actually, I lied...it looked like it was going to work, but I after the alert fires, I'm getting a dialog that says: "Image Uploader encountered some problem. If you see this message, contact web master." Here is my code: Code:function ImageUploader_BeforeUpload() {
var iu = getImageUploader('ImageUploader');
if (iu)
{
document.getElementById('UploadButton').disabled = false;
if (document.getElementById("LiveTextBox_Description"))
{
document.getElementById("LiveTextBox_Description").value);
if (document.getElementById('LiveTextBox_Description').value == '')
{
alert("Description must not be blank.");
return false;
}
else
{
iu.AddField("DescriptionVar", document.getElementById("LiveTextBox_Description").value);
return true;
}
}
else
{
iu.AddField("DescriptionVar", "");
return true;
}
}
}
Edited by user Wednesday, December 19, 2007 1:45:51 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Member, Administration, Moderator Joined: 9/19/2006(UTC) Posts: 506
Was thanked: 41 time(s) in 41 post(s)
|
This dialog shows only fact of error, but in order to get it's description try to use ShowDebugWindow. In this case error message will be more informative and, may be, error page from server will be shown. Edited by user Tuesday, February 19, 2008 4:09:39 PM(UTC)
| Reason: Not specified |
Best regards, Eugene Kosmin The Aurigma Development Team
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.