Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
Richard O'Neil  
#1 Posted : Sunday, September 24, 2006 10:35:09 PM(UTC)
Richard O'Neil

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
Eugene Kosmin  
#2 Posted : Monday, September 25, 2006 1:24:09 PM(UTC)
Eugene Kosmin

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 9/19/2006(UTC)
Posts: 414

Was thanked: 14 time(s) in 14 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. Aurigma Development Team
Richard O'Neil  
#3 Posted : Tuesday, September 26, 2006 12:25:22 AM(UTC)
Richard O'Neil

Rank: Member

Groups: Member
Joined: 6/2/2006(UTC)
Posts: 4

That was perfect....thanks alot. - Richard
Richard O'Neil  
#4 Posted : Tuesday, September 26, 2006 4:45:55 AM(UTC)
Richard O'Neil

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

Eugene Kosmin  
#5 Posted : Tuesday, September 26, 2006 2:29:38 PM(UTC)
Eugene Kosmin

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 9/19/2006(UTC)
Posts: 414

Was thanked: 14 time(s) in 14 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. Aurigma Development Team
Users browsing this topic
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.