I'm trying to do some validation of some other fields on the page after the user clicks the upload button of the ajaxfileupload control. OnClientUploadStart is defined to fire before the upload starts. and it works. but I want to cancel the upload if the validation fails. I tried doing "return false;" but that didn't work. How can I cancel the upload?
if the validation fails then I want to cancel
function uploadStart(sender, args) {
var FileDescription = document.getElementById("FileDescription").value;
alert( FileDescription);
return false;
}
<ajaxToolkit:AjaxFileUpload ID="AjaxFileUpload1"
ThrobberID="myThrobber" OnUploadComplete="AjaxFileUpload1_UploadComplete"
ContextKeys="" OnClientUploadError="uploadError" OnClientUploadComplete="uploadComplete" OnClientUploadStart="uploadStart"
AllowedFileTypes="jpg,jpeg,doc,xls"
MaximumNumberOfFiles="1"
runat="server"/>