Hi Brian,
When dynamically adding options for a select list, use the javascript Option()
object, something like so:
var v_option = new Option();
v_option.value = myOptionValue;
v_option.text = myOptionText
Then add the new object to the bottom of the list
var v_list = document.getElementById('mySelectList');
v_list.options[v_list.options.length] = v_option;
This way the select element itself doesn't change (and therefore the selected
value should have no problems posting). It's only the available options that
change.
Note, the above is cross-browser, MSIE, Firefox, Opera, Safair and Konqueror.
If you're building a new set of options every time, then remove the previous
set of options using a routine like the following:
Of course the trick to removing options is to delete them from the bottom up.
var v_list = document.getElementById('mySelectList');
for(var j = v_list.options.length; j >= 1; j--){
v_list.options[(j - 1)] = null;
}
Hope that helps.
Scott,
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf