[thelist] JavaScript - form.submit()

Anthony Baratta Anthony at Baratta.com
Fri Jul 28 15:47:18 CDT 2000


Scott_Brady at themoneystore.com wrote:
>
> < form action="index.cfm?FA=<cfoutput>#attributes.RFA.add#</cfoutput>"
> method="post" name="addJobForm" onSubmit="verifyForm(this); return false;">

Try this instead....

 < form action="index.cfm?FA=<cfoutput>#attributes.RFA.add#</cfoutput>"
 method="post" name="addJobForm" onSubmit="return verifyForm(this);">


function verifyForm(form1)
{
     varCheck = true;
     if (form1.job_title.value == "")
     {
          alert('You must enter a Job Title.');
          form1.job_title.focus();
          form1.job_title.select();
          varCheck = false;
     }
     else if (form1.job_code.value == "")
     {
          alert('You must enter a Job Code.');
          form1.job_code.focus();
          form1.job_code.select();
          varCheck = 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();
          varCheck = false;
     }

     if (varCheck) {
        form1.submit();
        return true;
     } else {
        return false;
     } 
}


-- 
Anthony Baratta
President
KeyBoard Jockeys
                    South Park Speaks Version 3 is here!!!
                       http://www.baratta.com/southpark
                              Powered by Tsunami




More information about the thelist mailing list