If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Maybe you are trying to do this

I guess you are trying to provide feedback to the user as he/she fills out the form by coloring the fields. Then also safeguarding against submitting the form while there are still form fields that are used incorrectly.

For checking a field when a user exits the field you can use 'onblur' on the fields. For safeguarding against incorrect forms being submitted you can use a function which returns a boolean in the 'onsubmit' event of the form.