View Single Post
  #3 (permalink)  
Old July 28th, 2003, 06:54 AM
mateenmohd mateenmohd is offline
Friend of Wrox
 
Join Date: Jun 2003
Location: abu dbabi, , United Arab Emirates.
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks.

yes, it will more better to check decimals
boths example, allow and not allow, how ?

Mateen


Quote:
quote:Originally posted by pgtips
 regular expressions are the way to go with this sort of thing, try
Code:
if ( /[^0-9]/.test(fn) ) { alert ("Please enter Numeric Value "); ... }
that will check whether the field contains any non-numeric characters, but it won't check for empty field, but this will:
Code:
if (!(/^\d+$/.test(fn)) ) { alert ("Please enter Numeric Value ");  }
Do you want to allow decimals, example 12.75?

rgds
Phil
Reply With Quote