RSS Forums RSS
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 3888 | Replies: 1
Reply
Join Date: Mar 2006
Posts: 1
Reputation: zbx888 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
zbx888 zbx888 is offline Offline
Newbie Poster

How to write javascript regular expression for this case?

  #1  
Mar 27th, 2006
I want to use Javascript to validate user input for last name and first name by regular expression and just allow usa alphebetical letters plus space, apostroph and hyphen such as O'Neill and Lacova-D'elia.

How to write regular expression to validate user's input? Thanks a lot!
:rolleyes:
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2006
Posts: 1,556
Reputation: masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light 
Rep Power: 11
Solved Threads: 144
masijade's Avatar
masijade masijade is online now Online
Posting Virtuoso

Re: How to write javascript regular expression for this case?

  #2  
Mar 28th, 2006
^[A-Za-z -']*$
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 3:29 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC