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

Notification

Icon
Error

Options
Go to last post Go to first unread
DSCarl  
#1 Posted : Wednesday, July 05, 2006 1:38:45 AM(UTC)
DSCarl

Rank: Member

Groups: Member
Joined: 4/25/2006(UTC)
Posts: 61

Hello,

I want to be able to display a message/messagebox to a user if the user clicks on the upload button without first
putting image/images on the third pane in the three pane ImageUploader.

By the third pane, I mean the pane at the bottom. I am using Custom buttons.

How do I go about doing this. Any help will be greatly appreciated...

Thanks.

MyCarl.

Fedor  
#2 Posted : Wednesday, July 05, 2006 2:32:02 AM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,545

Thanks: 5 times
Was thanked: 58 time(s) in 57 post(s)
To show the alert just check whether UploadFileCount property has 0 value.


Code:
if (getImageUploader('ImageUploader1')==0){
   alert("Please select at least one file.");
}



However for better usability I recommend you to disable upload button when there are no files selected. You can check this condition in UploadFileCountChange event handler:


Code:
function ImageUploader_UploadFileCountChange() {
   document.getElementById("UploadButton").disabled = (getImageUploader('ImageUploader1')==0);
}

iu.addEventListener("UploadFileCountChange", "ImageUploader_UploadFileCountChange");

Edited by user Monday, February 18, 2008 5:06:30 PM(UTC)  | Reason: Not specified

Best regards,
Fedor Skvortsov
DSCarl  
#3 Posted : Wednesday, July 05, 2006 5:41:04 AM(UTC)
DSCarl

Rank: Member

Groups: Member
Joined: 4/25/2006(UTC)
Posts: 61

Hello Fedor,

Thank you.

Best Regards,
MyCarl.
DSCarl  
#4 Posted : Wednesday, July 05, 2006 9:22:02 PM(UTC)
DSCarl

Rank: Member

Groups: Member
Joined: 4/25/2006(UTC)
Posts: 61

Hello Fedor,

In addition to your suggestion, I did the following and it worked great......

Code:
var value = getImageUploader("ImageUploaderID").getUploadFileCount();

if (value == 0){
    alert("Please select at least one file.");
}


Once again, thanks for your suggestions and help.

Regards,
MyCarl.

Edited by user Monday, February 18, 2008 5:07:01 PM(UTC)  | Reason: Not specified

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.