My web form will not validate for the required fields. It sends the results email correctly, the captcha works fine. Every thing about the form works except for required fields can be left empty upon submission. Maybe Joomla has something to do with it. Any help would be appreciated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
First you need to verify the form has been generated properly becuase there are some bugs that occur in certain cases during generation.
Find each field name for the required fields.
Look at the bottom of the form.html file for this section:
<SCRIPT type=text/javascript>
<!-
function validatePage3()
{
retVal = true;
if (validateField('field_24','fieldBox_24','checkbox',0) == false)
retVal=false;
if (validateField('field_25','fieldBox_25','checkbox',0) == false)
retVal=false;
if (validateField('field_26','fieldBox_26','checkbox',0) == false)
retVal=false;
if (validateField('field_27','fieldBox_27','checkbox',0) == false)
retVal=false;
if (validateField('field_28','fieldBox_28','menu',0) == false)
retVal=false;
if (validateField('field_29','fieldBox_29','menu',0) == false)
retVal=false;
if (validateField('field_30','fieldBox_30','checkbox',0) == false)
retVal=false;
if (validateField('field_33','fieldBox_33','textarea',0) == false)
retVal=false;
if(retVal == false)
{
alert('Please correct the errors. Fields marked with an asterisk (*) are required');
return false;
}
return retVal;
}
//->
</SCRIPT>
The "0" or "1" in these lines determines "required" or not.
NOT REQUIRED
if (validateField('field_33','fieldBox_33','textarea',0) == false)
REQUIRED
if (validateField('field_33','fieldBox_33','textarea',1) == false)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
My web form will not validate for the required fields. It sends the results email correctly, the captcha works fine. Every thing about the form works except for required fields can be left empty upon submission. Maybe Joomla has something to do with it. Any help would be appreciated.
First you need to verify the form has been generated properly becuase there are some bugs that occur in certain cases during generation.
Find each field name for the required fields.
Look at the bottom of the form.html file for this section:
<SCRIPT type=text/javascript>
<!-
function validatePage3()
{
retVal = true;
if (validateField('field_24','fieldBox_24','checkbox',0) == false)
retVal=false;
if (validateField('field_25','fieldBox_25','checkbox',0) == false)
retVal=false;
if (validateField('field_26','fieldBox_26','checkbox',0) == false)
retVal=false;
if (validateField('field_27','fieldBox_27','checkbox',0) == false)
retVal=false;
if (validateField('field_28','fieldBox_28','menu',0) == false)
retVal=false;
if (validateField('field_29','fieldBox_29','menu',0) == false)
retVal=false;
if (validateField('field_30','fieldBox_30','checkbox',0) == false)
retVal=false;
if (validateField('field_33','fieldBox_33','textarea',0) == false)
retVal=false;
if(retVal == false)
{
alert('Please correct the errors. Fields marked with an asterisk (*) are required');
return false;
}
return retVal;
}
//->
</SCRIPT>
The "0" or "1" in these lines determines "required" or not.
NOT REQUIRED
if (validateField('field_33','fieldBox_33','textarea',0) == false)
REQUIRED
if (validateField('field_33','fieldBox_33','textarea',1) == false)