>Changed the code to and added a name one of the form fields but a 
>javascript
>syntx error is occuring? what could cause this in the code below??
>
><SCRIPT LANGUAGE="JavaScript">
>
><!-- Begin
>function checkFields() {
>missinginfo = "";
>if (document.form.dltitle.value == "") {
>missinginfo += "\n     -  Title of the File Uploaded";
>}
>if (document.form.dlsummary.value == "") {
>missinginfo += "\n     -  Descriptive Summary of Uploaded File";
>}
>
>if (document.form.dlos.selectedIndex == 0 ||
>document.form.dlos.selectedIndex == 1)
>     missinginfo += "\n - Please select an operating system";
>     }
>
>if (document.form.area.selectedIndex == 0 ||
>document.form.area.selectedIndex == 1)
>     missinginfo += "\n - Please select the required area";
>     }
>
>if (missinginfo != "") {
>missinginfo ="_____________________________\n" +
>"You failed to correctly fill in the:\n" +
>missinginfo + "\n_____________________________" +
>"\nPlease re-enter the required details and submit again!";
>alert(missinginfo);
>return false;
>}
>else return true;
>}
>//  End -->

I think you need to be referring to your form elements as:

document.forms[0].fieldname.value == ""

as opposed to:

document.form.fieldname.value == ""

where forms[0] assumes there is only one form on your page. If there is more 
than one form, you would use forms[1], forms[2], etc.

Alternatively, you can refer to the "name" attribute of the form tag":

document.myForm.fieldname.value

I didn't check to see if "form" is what you named your form. If it is, try 
changing it, as it might be a reserved word.

Hope this helps,
Dave.



______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to