mredkj.com logo

An update blog for mredkj.com

What's this blog about?

mredkj.com is an unfocused programmer resource from Matt, Eric, and Keith

This blog will keep you up to date with our latest site changes.

Tuesday, August 30, 2005

JavaScript validate as you type

validate2.html

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):

Anonymous Anonymous wrote:

Wow, its great! Thanks!

Posted [1/04/2006 09:34:00 AM]  

Anonymous Anonymous wrote:

Perfect, indeed, thanks a lot!

Posted [2/01/2006 03:54:00 AM]  

Anonymous Anonymous wrote:

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]  

Blogger Keith wrote:

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]  

Anonymous Anonymous wrote:

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]  

Blogger Keith wrote:

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]  

Anonymous Anonymous wrote:

Wonderful Script and a great job. thank

Posted [8/18/2006 01:12:00 AM]  

Anonymous Anonymous wrote:

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]  

Blogger Keith wrote:

Maybe in the future we can look into improving the script. Thanks for visiting.

Posted [9/19/2006 09:56:00 AM]  

Anonymous Anonymous wrote:

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]  

Anonymous Anonymous wrote:

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]  

Anonymous Vinod wrote:

Hi,
Long time I am searching for a Good Function for Decimal Validation.
Wow!, Its great! and Working Fine!
Thanks!

Posted [12/17/2006 08:09:00 AM]  

Post a Comment