I have a form with serveral input fields. I want to validate
these fields. For example make sure the email input is in the
correct format, that the telephone input has only numbers, etc.
All of the tutorials I have looked at attach the AS to the
submit button. I do not want to do this. What I'd like to set up is
have AS check the input field entry to make sure it's correct PRIOR
to the submission of the form.
I don't have a solution for you. The reason that the existing
solutions that you've found use the submit event is quite simple.
It's the least intrusive place to check for errors. You have a
limited number of events where you can place this content checking
code. If you wanted to test the email address that the user entered
after that entry was made, how would you do that? You can tell when
the user gives focus to the textfield, you can tell when the user
enters a character, you can tell when the textfield loses focus.
None of these events is really appropriate for testing the content.
What is the problem with waiting until the submit button is