Lock It Up!
Our form has an odd characteristic, as it stands: A user can directly select and change the values of the Rate and Charge fields. This is just wrong; the Charge field calculates its own value and the rate is a constant, varying only whenever the company changes its rates. The user has no reason to selectlet alone changethese fields, so let’s prevent this from happening by locking them up. (The fields, that is. Locking up the user would work, too, though it’d be hard on sales in the long run.) Again, step-by-step:
- Click on the Edit button in the Forms panel, as we did before (back in Figure 3); once again we’re in the Form Editor and fields on the page are all represented by rectangles.
- Double-click on the Wakeup Rate field; you’ll be faced with the Field Properties dialog box, as before.
- Select the “Locked” checkbox in the lower-left of the General tab (Figure 13); from now on, users of the form won’t be able to select or change the Rate field.
- Click the Close button to dismiss the Field Properties dialog box.
- Click the Close Form Editing button (Figure 11); you will find that the only field you can now change among the Wake-ups set is the number of wake-ups.
Figure 13 Let’s lock the rate and the charge fields so that the user can’t mess around with things they have no reason to change directly.
While we’re still in the Form Editor, repeat steps 2-4 to lock the Wake-ups Charge field. Note that locking this calculated field prevents the user from changing the field’s value, but does not prevent the field from changing itself; the computation will happen normally.