I have a select element...
<select name="tour" id="tour">
<optgroup label="tour">
<option value="0" selected="selected">Please Select Tour</option>
<option value="Tour1">Tour1</option>
<option value="Tour2">Tour2</option>
</optgroup>
</select>
I have an array...
<?php $array = array(Tour1=>100,Tour2=>200); ?>
I have a field element...
<input type="text" size="5" id="distance" readonly="readonly" name="distance" value="" class="value" />
I'm looking to set up a jQuery script that looks for a change in the value in the select element 'tour', searches for it in my array, returns the associative value, and writes it to the value of my input field 'distance'.
Desired output: When Tour1 is selected, text input field 'distance' will show 100.