Rookie question: I have the following script. It works fine in everything but Firefox 3.0.8. It throws the error "DoUpload is not defined". I'm stumped. Here's the code:
<script type="text/javascript">
var done=false;
var document.forms.myForm=myform;
function DoUpload(){
if (myform.fullname.value==''){ alert('You must provide your name.'); return false; }
else if(myform.Project.value==''){alert('You must provide the project name.');return false;}
else if(myform.FileType.value==''){alert('You must provide the file type.');return false;}
else if(myform.email.value==''){ alert('You must provide your e-mail address.'); return false; }
else if(myform.filefield1.value=='' && myform.filefield2.value=='' && myform.filefield3.value=='' && myform.filefield4.value=='' && myform.filefield5.value==''){ alert('You must choose at least one file to upload.'); return false; }
else if(done==false){
done=true;
theFeats = "height=120,width=500,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no";
theUniqueID = (new Date()).getTime() % 1000000000;
window.open(" + theUniqueID, theUniqueID, theFeats);
document.myform.action = " + theUniqueID;
document.myform.submit();
}
}
</script>
<script type="text/javascript">
var done=false;
var document.forms.myForm=myform;
function DoUpload(){
if (myform.fullname.value==''){ alert('You must provide your name.'); return false; }
else if(myform.Project.value==''){alert('You must provide the project name.');return false;}
else if(myform.FileType.value==''){alert('You must provide the file type.');return false;}
else if(myform.email.value==''){ alert('You must provide your e-mail address.'); return false; }
else if(myform.filefield1.value=='' && myform.filefield2.value=='' && myform.filefield3.value=='' && myform.filefield4.value=='' && myform.filefield5.value==''){ alert('You must choose at least one file to upload.'); return false; }
else if(done==false){
done=true;
theFeats = "height=120,width=500,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no";
theUniqueID = (new Date()).getTime() % 1000000000;
window.open(" + theUniqueID, theUniqueID, theFeats);
document.myform.action = " + theUniqueID;
document.myform.submit();
}
}
</script>