581Chapter 25 .Text-Related Form Objects one of these (Affordable web design)
581Chapter 25 .Text-Related Form Objects one of these three event handlers in a text object. Because some events cannot occur without triggering others either immediately before or after (for example, an onFocus occurs immediately before an onSelectif the field did not have focus before), whatever actions you script for these events should be as distinct as possible to avoid interference or overlap. Note The onSelect event handler does not work in Windows versions of NN at least through Version 4. In particular, be careful about displaying modal dialog boxes (for example, window.alert() dialog boxes) in response to the onFocusevent handler. Because the text field loses focus when the alert displays and then regains focus after the alert is closed, you can get yourself into a loop that is difficult to break out of. If you get trapped in this manner, try the keyboard shortcut for reloading the page (Ctrl+R or -R) repeatedly as you keep closing the dialog box window. A question often arises about whether data-entry validation should be triggered by the onBluror onChangeevent handler. An onBlurvalidation cannot be fooled, whereas an onChangeone can be (the user simply doesn t change the bad entry as he or she tabs out of the field). What I don t like about the onBlurway is it can cause a frustrating experience for a user who wants to tab through a field now and come back to it later (assuming your validation requires data be entered into the field before submission). As in Chapter 43 s discussion about form data validation, I recommend using onChangeevent handlers to trigger immediate data checking and then using another last-minute check in a function called by the form s onSubmit event handler. On the CD-ROM Example (with Listing 25-5) on the CD-ROM onChange NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility . . . Of all the event handlers for a text object, you will probably use the onChange handler the most in your forms (see Listing 25-6). This event is the one I prefer for triggering the validation of whatever entry the user just typed in the field. The potential hazard of trying to do only a batch-mode data validation of all entries before submitting an entire form is that the user s mental focus is away from the entry of a given field as well. When you immediately validate an entry, the user is already thinking about the information category in question. See Chapter 43 for more about data-entry validation. document.formObject.textObject.onChange
Check Tomcat Web Hosting services for best quality webspace to host your web application.