Mar 7, 2001, 12:50 PM
Post #2 of 2
If you want to change another value in the form you can have the select field use an 'onChange' option.
Re: Changing two values with one pull-down in a form?
[In reply to]
Here is an example that I use to set another select box and place a value into a text box...
However, you probably don't need this heavy a solution in this case. As you are storing the value in a hidden field, the user will not see it, and thus does not notice that the value is changing. So you can change your option tags to hold both bits of information directly...
onChange="this.form.id.value = this.form.sampleid.options[this.form.sampleid.selectedIndex].value;
this.form.type.selectedIndex = this.form.sampleid.selectedIndex;">
And then have your script do a split on '---' to get the two values.
<option value="red car---199">red car</option>
Sun Sep 9, 2001 - 1:46:40 GMT, a very special second in the epoch. How will you celebrate?