Click to See Complete Forum and Search --> : [RESOLVED] Text field with numeric value only?


Phill Pafford
11-09-2006, 08:11 AM
Hi All,

does HTML have a text field that is a numeric only value?

example:

I have a text field and I only want numbers to be enterd, does html have this? or is this some sort of javascript validation?

gil davis
11-09-2006, 08:50 AM
No. All text fields are strings.

You have to make sure that your script has sufficient information to convert it to a number, or explicitly use a conversion function such as parseInt().

You can use "regexp" to enforce numerics in a validation script.

Phill Pafford
11-09-2006, 09:01 AM
thanks