get the Value of a Select box
11
I use this in my AJAX as a quick way to get the Value of the selected item in a Select HTML object. If nothing is selected, it returns zero.
(May be basic to y'all, but maybe really usefull to someone else).
(May be basic to y'all, but maybe really usefull to someone else).
function fn_SelectedValue(selectId)
{
theSelect = document.getElementById(selectId);
selectedValue = theSelect.option[theSelect.selectedIndex].value;
if(!selectedValue || selectedValue==null)
{
selectedValue = 0;
}
return selectedValue;
}






document.getElementById('youselectboxid').value
this will also return the value of the select box's value
Regards,
Kumar S
GuyFromChennai.com