You can accomplish more sophisticated validation, such as restricting data to specific values and characters, through the use of JavaScript. You might, for example, want to limit a date entry to only the years between 1950 and 2000 or allow a password that only contains three letters and four numbers separated by a dash.
To set a data range or attach a JavaScript to validate a field, click one of the radio buttons on the Validate tab:
- Field Value Is Not Validated: The default state. This radio button is selected automatically if a field does not use number or percentage formats (selected on the Format tab). Otherwise, click this option if you don’t want validation applied to data entered in a field.
- Field Value Is In Range: Provides two text boxes in which to define upper- and lower-range parameters. Type a number in the From or To field to specify limits on a data range.
- Run Custom Validation Script: Click the Edit button to open the JavaScript Edit window. If you’re familiar with JavaScript language, you can write your own or copy and paste a predefined JavaScript in the script editing window. Click OK to close the JavaScript Edit window. The validation script appears in a preview box below the Run Custom Validation Script radio button. Note that you can use the arrow keys to view the script, but you can’t edit it.
0 comments:
Post a Comment