dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: How to set validation of phone numbers like design?

  1. #1
    Join Date
    Sep 2005
    Posts
    1,657

    How to set validation of phone numbers like design?

    How to set validation of phone numbers like design?
    Attached Images Attached Images

  2. #2
    Join Date
    Jul 2013
    Location
    Voorheesville NY USA
    Posts
    1,121
    If I really really had to do this, I would just use js to validate the number and re-format after the user has made his entire entry. Of course - you would then have to remove this formatting before storing it to keep it in a easily useable format in your db. I would never store a telephone number like that.

    Something like:
    [code]
    <input type='text' name='telno' id='telnoid' size=10 onchange='return validateTelNo("telnoid")'>
    [\code]

  3. #3
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,963
    formatting, it looks nice but in all cases is not really necessary.

    you only need to know that all characters are numerical, allow people to format how they are used to, when you submit to a database then store the number in whatever format that floats your boat.
    STOP using $ prefix on JavaScript variable names...
    Please remember to wrap any code you have in forum tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

Thread Information

Users Browsing this Thread

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

Posting Permissions

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



Recent Articles