I have a little form which is used for searching on on my ASP page. My question is regarding the <select>. It uses javascript to chuck the data into it.
Quick Example:
Now if I submit this form I want to retain the item that has been selected in the drop down but the data sent through is the value and not the selectedIndex. Is it still possible to set the selection option using just the value?
Ideally I would recode it to be an ASP generated drop but I'm just taking what was handed to me im just trying to fix it for now.
Any help would be appreciated.
Thanks!
- FateFirst
Quick Example:
Code:
var country_select = document.searchForm.COUNTRIES_VALUE;
country_select.options[0] = new Option("All");
country_select.options[0].value = 0;
country_select.options[1] = new Option("America");
country_select.options[1].value = 2;
country_select.options[2] = new Option("Austria");
country_select.options[2].value = 27;
country_select.options[3] = new Option("Bulgaria");
Now if I submit this form I want to retain the item that has been selected in the drop down but the data sent through is the value and not the selectedIndex. Is it still possible to set the selection option using just the value?
Ideally I would recode it to be an ASP generated drop but I'm just taking what was handed to me im just trying to fix it for now.
Any help would be appreciated.
Thanks!
- FateFirst