faqts : Computers : Programming : Languages : JavaScript : Forms

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

2 of 6 people (33%) answered Yes
Recently 2 of 6 people (33%) answered Yes

Entry

How do you perform validation on an optional field when you actually click in the field.

May 3rd, 2002 15:54
Mark Paschal, Stacey Taylor,


Perform the validation in the field's onfocus handler rather than the
form's onsubmit handler. Actually doing it when clicking the field
probably isn't what you mean, so you may actually want the onblur or
onchange handler.