Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , ,

Sponsored Links



How to validate client side javascript for phone number

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 18-08-2009
Member
 
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.
Reply With Quote
  #2  
Old 18-08-2009
Justvicks's Avatar
Member
 
Join Date: Feb 2006
Posts: 130
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>
Reply With Quote
  #3  
Old 18-08-2009
Shell's Avatar
Member
 
Join Date: Mar 2008
Posts: 233
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.
Reply With Quote
  #4  
Old 18-08-2009
Member
 
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to validate client side javascript for phone number"
Thread Thread Starter Forum Replies Last Post
Number Keys on Right Side is not Working Skullnit Hardware Peripherals 2 04-09-2011 06:08 PM
HTTPS client-side POST ISAIAH Software Development 6 23-01-2010 10:38 AM
How to validate IMEI number of Lephone a1 SANG18 Portable Devices 4 11-12-2009 03:16 PM
Difference between Server-side and Client-side code? Booth Software Development 2 08-01-2009 03:21 PM
Force a client (2000/XP) to validate its logon against a specific Aleric Window 2000 Help 3 10-07-2006 08:19 PM


All times are GMT +5.5. The time now is 11:22 AM.