[Javascript] text box

Peter Brunone peter at brunone.com
Sat Jul 13 23:07:14 CDT 2002


Andrew,

	You can add an event handler to check the value on change, on blur, etc.
(or just put the check in the form submission) and then use a regular
expression or custom function to determine the appropriateness of the value.
Of course, with currency, you're just putting in a number anyway; the type
is rather incidental, and should probably be in a dropdown list of its own.
	For what it's worth, I usually do separate inputs for month, day, and year
or the three pieces of a phone number; this makes validation easier and cuts
down on the possible mistakes made by users.

Cheers,

Peter

|-----Original Message-----
|From: javascript-admin at LaTech.edu [mailto:javascript-admin at LaTech.edu]On
|Behalf Of Andrew Dunn
|
|Hi,
|	Is it possible to format a text box "<input type=text>" so it only
|accepts certain values like a date value or a currency value?
|
|Thanks.
|




More information about the Javascript mailing list