View Full Version : frmvalidator.addValidation function

12-19-2006, 03:37 PM
<form action="http://www.midohioit.com/quote/quote.php" enctype="multipart/form-data" method="post" name="quoteform" id="quoteform">

<script language="JavaScript" type="text/javascript">

var frmvalidator = new Validator("quoteform");

frmvalidator.addValidation("name","req","Please enter your Name");
frmvalidator.addValidation("name","maxlen=50","Maximum length for Name is 50 characters.");
frmvalidator.addValidation("name","minlen=3","Minimum length for Name is 3 characters.");

frmvalidator.addValidation("company2","req","Please enter your Company Name");
frmvalidator.addValidation("company2","maxlen=50","Maximum length for Company Name is 50 characters.");
frmvalidator.addValidation("company2","minlen=3","Minimum length for Company Name is 3 characters.");
frmvalidator.addValidation("budget","dontselect=0","Please select a range for your Budget.");

//following line does not work
//frmvalidator.addValidation("designtype1","checked","Please check as least one box for the Work needed area." );




I am having problems getting the frmvalidator.addValidation function to work for a checkbox is there a way I can just use the existing frmvalidator.addValidation function for a checkbox??


12-19-2006, 07:48 PM
You can add a custom validation for checkboxes as in the code below. Check out the link below for a complete list of validation descriptors.


function DoCustomValidation()
var frm = document.forms["quoteform"];
alert('The checkbox is not checked!');
return false;
return true;


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum