Setting One Field with Another
With your forms, you'll often find that if the user makes one choice, that choice dictates the value of other fields on the form. For example, let's say that the sunroof option is only available on a two-door model. You could deal with this in two ways. First, you could check the entry and put up an alert dialog if the user makes the wrong choice. But it's a slicker design to simply make the entry for the user. So if they pick the sunroof, the script automatically clicks the two-door button, as in Figure 7.10. Script 7.13 shows you how.
Figure 7.10. When the user checks the sunroof option, the script automatically sets the two-door radio button.
Script 7.13. A sophisticated way to handle user choices lets you control and set field entries based on other choices made by the user.
To set a field value automatically: