Results 1 to 2 of 2

Thread: FORM VALIDATION: adding "restrictions" to email field

  1. #1
    Join Date
    Jun 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question FORM VALIDATION: adding "restrictions" to email field

    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!!!

    Code:
    <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.

  2. #2
    Join Date
    Jun 2007
    Posts
    543
    Thanks
    3
    Thanked 78 Times in 78 Posts
    Blog Entries
    1

    Default

    is there other javascript code?
    [Jasme Library (Javascript Motion Effects)] My Site
    /\/\@§†ê® §©®¡þ† /\/\@|{ê®
    There are 10 kinds of people in the world, those that understand binary and those that don't.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •