format ssn

Results 1 to 2 of 2

Thread: format ssn

  1. #1
    Join Date
    Dec 1969

    Default format ssn

    i need a javascript function to format a ssn with dashes

  2. #2
    Join Date
    Dec 1969

    Default RE: format ssn

    Throw this function in there. Call it &#039;onblur&#039; of your SSN textbox. You also need to throw a little something in there before it formats it to check to see if it has the correct amount of digits. It could give you a funky result. <BR><BR>function convertSSN()<BR>{<BR> SSN = document.all.nameOfTextBox.value<BR> slice1 = SSN.slice(0,3)<BR> slice2 = SSN.slice(3,5)<BR> slice3 = SSN.slice(5,10)<BR> newSSN = slice1 + &#039;-&#039; + slice2 + &#039;-&#039; + slice3<BR> alert(newSSN)<BR>}

Posting Permissions

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