You can use client-side JavaScript to designate scripts to run in client-browser sessions. Because JavaScript enables fast responses to mouse clicks, form inputs, and page-navigation actions, it is useful for validating form information.
For example, you can script a JavaScript function on the HTML page to confirm that users entered required information, such as address and telephone number. If required information was not supplied, the embedded script displays a dialog box. Thus, server response is required only for non-scriptable browser functions, and, by using JavaScript, you avoid form redrawing, server processing and download of invalid data.
Object model methods that are not supported and properties that are associated with OnClientXXX event scripts are ignored by Internet Explorer and Safari. When, in a script, Netscape 7 and Mozilla encounter non-supported object model methods and properties, execution stops. Only some object model methods and properties can be associated with OnclientXXX scripts: TextBox.Text, TextBox.Enable, TextBox.Visible, TextBox.Font, TextBox.Scrollable, TextBox.Name, TextBox.Password, and TextBox.Type. |