Category: Questionmark Perception

Javascript validation as a condition for a second function in the same event handler

We use Questionmark quizzing software at my job to create quizzes and tutorials. One of several issues we have had with it has been a login page which did not validate for the kind of ID number we wanted to use. In fact it did not validate at all! We were told that either it couldn’t be done because it would not work with the software (the login page submits some .asp variables), or it would cost us to have it done by their programmers – so we set about trying to make it happen.

The problem was that it uses the onSubmit event to trigger some fancy new window actions. I wanted the validation to take place and stop the new window action as well as the “submitting” action itself. So my first thought was to put a standard validation script on an onBlur event. In other words when people moved the cursor from the validated field to the next field, the validation would occur.

Continue reading