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.
|
|
|
|
Rank: Advanced Member
Groups: Member, Administration, Moderator Joined: 7/28/2003(UTC) Posts: 1,660
Thanks: 5 times Was thanked: 76 time(s) in 74 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
|
|
|
|
Rank: Member
Groups: Member
Joined: 4/25/2006(UTC) Posts: 61
|
Hello Fedor,
Thank you.
Best Regards, MyCarl.
|
|
|
|
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
|
|
|
|
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.