Results 1 to 4 of 4

Thread: How to validate client side javascript for phone number

  1. #1
    Join Date
    Nov 2008
    Posts
    73

    How to validate client side javascript for phone number

    How to validate the client side validation along with your programming language validation. This ValidateNo function receive two arguments. I have set the two parameters First argument is html / server control value, which should be entered by user and Second argument is comparision string.

  2. #2
    Join Date
    Feb 2006
    Posts
    172

    Re: How to validate client side javascript for phone number

    Following is the simple HTML coding that gives you the client side html coding which will allow you to insert the phone number of an client that will submit the number. Just copy paste the program on the text file and HTML extension.

    Code:
    <form name="Form1" onsubmit="return FormValidate()">
    <input type="text" size="25" name="PhoneNumber" />
    <br /><br />
    <input type="submit" value="Submit" />
    </form>

  3. #3
    Join Date
    Mar 2008
    Posts
    232

    Re: How to validate client side javascript for phone number

    You store something as numeric when you need to calculate its value (such as add another number to it), or sort ascending / descending. NumStr : This is the value which you want to validate. It will come from your form control. It may by TextBox control (HTML or ServerControl). The problem with this code is you can add in more than 4 digits at the end.

  4. #4
    Join Date
    Dec 2008
    Posts
    161

    Re: How to validate client side javascript for phone number

    To solve the additional digits at the end and prevent digits at the beginning the expression should read (/^\\d{3}\\-\\d{3}\\-\\d{4}$/)==-1). Use your cursor to highlight the script, and copy (type Control-c or Apple-c) the script into a new file in your text editor (such as Note Pad or Simple Text) and save (Control-s or Command-s). This data is passed to ASP script, or some other technology and if the data contains an error.

Similar Threads

  1. Number Keys on Right Side is not Working
    By Skullnit in forum Hardware Peripherals
    Replies: 3
    Last Post: 25-04-2012, 04:19 AM
  2. Replies: 3
    Last Post: 27-02-2011, 07:24 AM
  3. HTTPS client-side POST
    By ISAIAH in forum Software Development
    Replies: 6
    Last Post: 23-01-2010, 10:38 AM
  4. How to validate IMEI number of Lephone a1
    By SANG18 in forum Portable Devices
    Replies: 4
    Last Post: 11-12-2009, 03:16 PM
  5. Difference between Server-side and Client-side code?
    By Booth in forum Software Development
    Replies: 2
    Last Post: 08-01-2009, 03:21 PM

Tags for this Thread

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
  •  
Page generated in 1,711,715,338.32213 seconds with 17 queries