Reputation: 10607
Does anyone know how to get the values from an asp dropdownbox (not just the selected one) using javascript?
Upvotes: 0
Views: 106
Reputation: 943571
Assuming you mean a <select>
element - just loop over its options
property.
var options = refToMyForm.elements.mySelect.options;
for (var i = 0, j = options.length; i < j; i++) {
var option = option[i];
var value = option.value;
}
Upvotes: 5