Tutorials Forums
     Tutorials Videos
        Sign Up Now For FREE
Welcome, Guest
Username Password: Remember me

Alphabetic Characters Only
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Alphabetic Characters Only

Alphabetic Characters Only 12 Dec 2009 04:27 #109

Well since it's the first.. Why not make it a simple one. This snippet will test to make sure that a said variable contains only alphabetic characters.

Instructions: Well there are many different ways in which you can use regular expressions with JavaScript, you can learn more about them at www.regular-expressions.info/

Here we're just going to test a variable to make sure that it only contains alphabetic characters, using the 'test' method. For instance, some type of 'Name' field.
^\D*[a-zA-Z]?$
  • CE
  • OFFLINE
  • Administrator
  • Posts: 197
  • Karma: 78
CodersEngine
  • Page:
  • 1
Moderators: mnjon
Time to create page: 0.24 seconds