+ Reply to Thread
Results 1 to 3 of 3




  

Thread: JavaScript Proper Social Security Number Validation

      
  1. #1
    Jedi Master JavaScriptBank is on a distinguished road
    Join Date
    July 10, 2009
    Posts
    167
    Rep Power
    3
    Feedback Score
    0

    Default JavaScript Proper Social Security Number Validation

    One more JavaScript code example to accept numeric characters. But this JavaScript will work in the different manner, it on... detail at JavaScriptBank. com - 2.000+ free JavaScript codes

    [IMG]hxxp ://w w w.javascriptbank. com/javascript.images/form/javascript-proper-social-security-number-validation.jpg[/IMG]
    Demo: JavaScript JavaScript Proper Social Security Number Validation

    How to setup

    Step 1: Copy & Paste JavaScript code below in your HEAD section
    JavaScript
    Code:
    <script type="text/javascript">
    // Created by: Mr. J | hxxp ://w w w.huntingground. net
    // This script downloaded from w w w.JavaScriptBank. com
    
    function advance2(currentField,nextField,limit) {
      if(nextField!="rset"&&document.myForm2[currentField].value.length == limit){
        document.myForm2[nextField].select();
      } else {
        if (document.myForm2[currentField].value.length == limit) {
          document.myForm2[currentField].maxLength=limit
          document.myForm2[nextField].select()
          document.myForm2[nextField].disabled=false
          document.myForm2[currentField].blur()
          document.myForm2[nextField].style.backgroundColor="#EFCCA4"
        }
      }
    }
    </script>
    Step 2: Copy & Paste HTML code below in your BODY section
    HTML
    Code:
    <p>
    This form is formatted for a social security number (XXX-XX-XXXX).</p>
    
    <form name="myForm2" onreset="this.rset.disabled='true'; this.rset.style.backgroundColor=''">
    <input type="text" name="t1" size="6" onclick="select()" onKeyUp="advance2('t1','t2',3)">
    <input type="text" name="t2" size="6" onclick="select()" onKeyUp="advance2('t2','t3',2)">
    <input type="text" name="t3" size="6" onclick="select()" onKeyUp="advance2('t3','rset',4)">
    <input type="reset" name="rset" onclick="this.blur()" disabled>
    </form>
    
    <div style="text-align: left; width: 70%;">
    <p>
    The limit for each individual field is passed to the function by the appropriate input event, as shown in the form using the format: <code>onKeyUp="advance2('currentField','nextField',limit)</code>"</p>
    </div>





    JavaScript Bookmark Page script - JavaScript Color Wheel - JavaScript Image slideshow

  2. #2
    Jedi Master mahesh10 is on a distinguished road
    Join Date
    June 17, 2010
    Location
    USA
    Posts
    239
    Rep Power
    2
    Feedback Score
    0

    Default Re: JavaScript Proper Social Security Number Validation

    Quote Originally Posted by JavaScriptBank View Post
    One more JavaScript code example to accept numeric characters. But this JavaScript will work in the different manner, it on... detail at JavaScriptBank. com - 2.000+ free JavaScript codes

    [IMG]hxxp ://w w w.javascriptbank. com/javascript.images/form/javascript-proper-social-security-number-validation.jpg[/IMG]
    Demo: JavaScript JavaScript Proper Social Security Number Validation

    How to setup

    Step 1: Copy & Paste JavaScript code below in your HEAD section
    JavaScript
    Code:
    <script type="text/javascript">
    // Created by: Mr. J | hxxp ://w w w.huntingground. net
    // This script downloaded from w w w.JavaScriptBank. com
    
    function advance2(currentField,nextField,limit) {
      if(nextField!="rset"&&document.myForm2[currentField].value.length == limit){
        document.myForm2[nextField].select();
      } else {
        if (document.myForm2[currentField].value.length == limit) {
          document.myForm2[currentField].maxLength=limit
          document.myForm2[nextField].select()
          document.myForm2[nextField].disabled=false
          document.myForm2[currentField].blur()
          document.myForm2[nextField].style.backgroundColor="#EFCCA4"
        }
      }
    }
    </script>
    Step 2: Copy & Paste HTML code below in your BODY section
    HTML
    Code:
    <p>
    This form is formatted for a social security number (XXX-XX-XXXX).</p>
    
    <form name="myForm2" onreset="this.rset.disabled='true'; this.rset.style.backgroundColor=''">
    <input type="text" name="t1" size="6" onclick="select()" onKeyUp="advance2('t1','t2',3)">
    <input type="text" name="t2" size="6" onclick="select()" onKeyUp="advance2('t2','t3',2)">
    <input type="text" name="t3" size="6" onclick="select()" onKeyUp="advance2('t3','rset',4)">
    <input type="reset" name="rset" onclick="this.blur()" disabled>
    </form>
    
    <div style="text-align: left; width: 70%;">
    <p>
    The limit for each individual field is passed to the function by the appropriate input event, as shown in the form using the format: <code>onKeyUp="advance2('currentField','nextField',limit)</code>"</p>
    </div>





    JavaScript Bookmark Page script - JavaScript Color Wheel - JavaScript Image slideshow
    Hi,
    i have reviewed your code but what does mean social number validation
    is that for validation for using number Nothing seemed to work in this code
    here is the screen shot of the result
    Attached Images Attached Images

  3. #3
    I'm New! shelinauto is on a distinguished road
    Join Date
    March 17, 2011
    Posts
    3
    Rep Power
    0
    Feedback Score
    0

    Default Re: JavaScript Proper Social Security Number Validation

    its really seems useful. i m going to use it on my site.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Simple JavaScript Number Formatter
    By JavaScriptBank in forum HTML & Website Design
    Replies: 0
    Last Post: Jan 13th, 2011, 6:28 am
  2. Proper way of Link Wheel
    By amitmax in forum SEO Forum
    Replies: 3
    Last Post: Sep 9th, 2010, 7:44 am
  3. Five Tricks for Improving JavaScript Security
    By JavaScriptBank in forum HTML & Website Design
    Replies: 0
    Last Post: Jul 30th, 2010, 8:00 pm
  4. JavaScript Numeric Validation
    By ferrariboy21 in forum HTML & Website Design
    Replies: 0
    Last Post: Nov 9th, 2008, 5:39 am
  5. Is proper background (schooling) necessary for a web designer?
    By rozehrocks in forum HTML & Website Design
    Replies: 23
    Last Post: Jul 27th, 2007, 4:00 pm

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
WebTalkForums
WebTalkForums
Recent Forum Threads