I want to validate a field in a form, using onblur. If the field is empty, or contains data in the wrong format, I display an error message alongside that field, using addmessage. So far so good.
Now I want to force the user to respond, so I want to restore focus to that field, and not let them carry on until it is correctly filled in.
I want to delete the error message at an appropriate point (not sure how to do this either - maybe a timeout?),so that if it fails a second time only the relevant error message is displayed.
I'm new to javascript. Hope that is not asking too much at once! Any links to working examples greatly appreciated.
Now I want to force the user to respond, so I want to restore focus to that field, and not let them carry on until it is correctly filled in.
I want to delete the error message at an appropriate point (not sure how to do this either - maybe a timeout?),so that if it fails a second time only the relevant error message is displayed.
I'm new to javascript. Hope that is not asking too much at once! Any links to working examples greatly appreciated.