Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error: DoUpload is not defined

Status
Not open for further replies.

mmcnab

IS-IT--Management
Dec 30, 2008
1
US
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>
 
I'm stumped as well, because you're never calling 'DoUpload', so why would it error?

Or, perhaps you are calling it, but have omitted this crucial piece of code that gives us context?

How about posting a URL to the live page?

One thing I would query, however, is this line:

Code:
var document.forms.myForm=myform;

What is the purpose of this? Surely you would want to read from the forms collection, never write to it?

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top