Hi.
I have a list of data that is something along the following:
<select name="samplelist">
<option value="1">Item 1</option>
<option value="3">Item 2</option>
<option value="6">Item 3</option>
<option value="18">Item 4</option>
<option value="36">Item 5</option>
<option value="235">Item 6</option>
</select>
I want it so when I click a button it takes the value of another field and finds it in this drop down and select it.
I have found many scripts but they dont appear to work correctly. They seem to go for the index rather then the value. So if this value in the other field is 3 and I click the button it selects Item 3, which is incorrect. It should select Item 2 but as Item 3 is in index '3' thats the item selected.
Any help would be appreciated.
Thanks!
- FateFirst
I have a list of data that is something along the following:
<select name="samplelist">
<option value="1">Item 1</option>
<option value="3">Item 2</option>
<option value="6">Item 3</option>
<option value="18">Item 4</option>
<option value="36">Item 5</option>
<option value="235">Item 6</option>
</select>
I want it so when I click a button it takes the value of another field and finds it in this drop down and select it.
I have found many scripts but they dont appear to work correctly. They seem to go for the index rather then the value. So if this value in the other field is 3 and I click the button it selects Item 3, which is incorrect. It should select Item 2 but as Item 3 is in index '3' thats the item selected.
Any help would be appreciated.
Thanks!
- FateFirst