PDA

View Full Version : FORM VALIDATION: adding "restrictions" to email field



deltatango5
01-18-2008, 08:35 PM
I have a simple javascript form validation, but am trying to add another piece to the "email" area whereas people cannot insert certain emails (hotmail, yahoo, etc.). Does anyone have some intuition as to the direction to point me? Your assistance is greatly appreciated!!!


<script language="JavaScript" type="text/javascript">
//You should create the validator only after the definition of the HTML form
var frmvalidator = new Validator("sub");
frmvalidator.addValidation("first_name","req","Please enter your First Name");

frmvalidator.addValidation("last_name","req","Please enter your Last Name");

frmvalidator.addValidation("email","req");
frmvalidator.addValidation("email","email");

frmvalidator.addValidation("phone","req","Please enter your Phone Number ex. 408-555-1234");

frmvalidator.addValidation("state","req","Please enter your State");
</script>



Thanks in advance!
Des

ps. if you have a more thorough javascript validation method and/or code snippet I can incorporate, that would be great.

Master_script_maker
01-19-2008, 02:19 AM
is there other javascript code?