[thelist] JavaScript - form.submit()

Alessandro Alessandro at bodytrends.com
Fri Jul 28 14:07:29 CDT 2000


You need to call your form name="form1" or say addJobForm.submit

let me know if that's it


Alessandro
Web Research and Development                 
Alessandro at bodytrends.com  
http://www.bodytrends.com  



> 
> In the HTML:
> 
> < form action="index.cfm?FA=<cfoutput>#attributes.RFA.add#</cfoutput>"
> method="post" name="addJobForm" onSubmit="verifyForm(this); 
> return false;">
> 
> The verifyForm function in the JavaScript looks like:
> 
> function verifyForm(form1)
> {
> 
>      if (form1.job_title.value == "")
>      {
>           alert('You must enter a Job Title.');
>           form1.job_title.focus();
>           form1.job_title.select();
>           return false;
>      }
>      else if (form1.job_code.value == "")
>      {
>           alert('You must enter a Job Code.');
>           form1.job_code.focus();
>           form1.job_code.select();
>           return false;
>      }
>      else if ( (form1.Grade.value == "") || 
> (!isInteger(form1.Grade.value)) )
>      {
>           alert('You must enter a numeric value for the Grade.');
>           form1.Grade.focus();
>           form1.Grade.select();
>           return false;
>      }
> 
>      form1.submit();
> }
> 
> Thanks!
> 
> Scott
>




More information about the thelist mailing list