Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TextBox Validation

Status
Not open for further replies.

liorlankril

Programmer
Nov 5, 2005
46
IL

I need Javascript code that check that my string value contain only: a-z, A-Z, ',- or space.

How to do it???
 
this should do it:

Code:
function validate(){
if (/[^A-z|\s]/.test(form1.inputvalue.value)) {
 alert ("Only letters please!")
 }
 }

Cheers

Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top