Tuesday, August 30, 2005
JavaScript validate as you type
Only numbers. Negative allowed at beginning. 2 decimal places allowed.
I appreciate any feedback about the script, or about the usability of the validation.
posted by Keith [8/30/2005 02:05:00 PM] - permalink - 12 comments
12 comment(s):
Wow, its great! Thanks!
Posted [1/04/2006 09:34:00 AM]
Perfect, indeed, thanks a lot!
Posted [2/01/2006 03:54:00 AM]
hi,
thank's
i need to validate just letter some of them, how can i do it.
Posted [3/12/2006 11:43:00 AM]
Anonymous wrote:
"i need to validate just letter some of them, how can i do it."
I'd need more information to help you out.
Do you need to validate as the person is typing?
Do you need to make sure certain letters are in the input, or the only letters in the input? e.g. If you're testing for 'ab', is 'abc' ok?
Posted [3/12/2006 04:27:00 PM]
Good concise code. thanx
After inputting correctly the numbers how do u display the numbers in Thousands format. That is 9123456 = 9,123,456?
Thanx a lot
Posted [7/08/2006 02:51:00 PM]
Anonymous wrote...
After inputting correctly the numbers how do u display the numbers in Thousands format.
Take a look at
http://www.mredkj.com/javascript/nfbasic.html
Posted [7/12/2006 01:47:00 AM]
Wonderful Script and a great job. thank
Posted [8/18/2006 01:12:00 AM]
Great and useful script!!!
Is it possible to leave the field formated? Example:
First and last input is a "." - leaving the field should show "0.00"
or ".2" ==> "0.20"
or "23.7" ==> "23.70"
A great help would be also if a comma is changed to a dot. In other words: pressing "," is handled as "."
Thanx for this useful script!
Bob
Posted [9/14/2006 09:47:00 AM]
Maybe in the future we can look into improving the script. Thanks for visiting.
Posted [9/19/2006 09:56:00 AM]
Hi Keith,
I look forward for the improvements ...
There is also a problem jumping from field to field with the tab key if there is an input in the fields.
With firefox this works great, but IE fails - filled fields are skipped.
Bob
Posted [9/19/2006 01:17:00 PM]
Keith:
I've been doing similar validation for a while now, but your code is a lot more concise than what I've been doing. Glad to have found your scripts! :)
Sincerely,
Keith Pepin
Posted [10/18/2006 10:16:00 AM]
Hi,
Long time I am searching for a Good Function for Decimal Validation.
Wow!, Its great! and Working Fine!
Thanks!