Javascript allow only alphabets validation

Tutorials Shared by the Internet Community

Advertisements


Javascript allow only alphabets validation

this is a only alphabets javascript validation script for users who want to allow only alphabets in text box and no numbers in text box.

Statistics

  • Total Hits - 35056

  • Total Votes - 129 votes

  • Vote Up - 54 votes

  • Vote Down - 75 votes

  • Domain - webprogrammingscripts.blogspot.com

  • Category - Java Script/Validations

  • Submitted By - bholu

  • Submitted on - 2009-07-23 22:42:08

Description

this is a only alphabets javascript validation script for users who want to allow only alphabets in text box and no numbers in text box. good handy script for all users.try it out and give out your comments if you like this script<br /><br /><html><br /><head><br /><title>only alphabets</title><br /><script language="javascript" ><br />function checkName()<br />{<br />re = /^[A-Za-z]+$/;<br />if(re.test(document.insertDetails.uname.value))<br />{<br />alert('Valid Name.');<br />}<br />else<br />{<br />alert('Invalid Name.');<br /><br />}<br /><br />}<br /></script><br /><br /></head><br /><br /><body><br /><br /><form name="insertDetails" ><br />Enter your name: <input type="text" name="uname" /><br /><br /><br /><input type="button" value="Check" onClick="checkName()" /><br /><br /></form><br /><br /><body><br /><br /></html>    More detail...


Broken  |   Tweet  |   Facebook  |     |   Save  |   Liked  |   Down

Advertisements