|
|
Rank: Member Groups: Member
Joined: 4/26/2006 Posts: 61 Points: 0
|
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: Administration
, Member
Joined: 7/28/2003 Posts: 1,254 Points: -345 Location: WA, US
|
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");
Best regards, Fedor Skvortsov
|
|
Rank: Member Groups: Member
Joined: 4/26/2006 Posts: 61 Points: 0
|
Hello Fedor,
Thank you.
Best Regards, MyCarl.
|
|
Rank: Member Groups: Member
Joined: 4/26/2006 Posts: 61 Points: 0
|
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.
|
|
|
Guest |