11 lut 2008

Odczyt wartości text i value z option w comboBox

Przepisanie wartości text i value z ComboBox (Select) do tablicy

fn = 'nazwa_formy';
var form = document.forms[fn];
var destinations_save = new Array();

for (i = 0; i < form.destination.options.length; i++) {
  destinations_save[i] = new Array(form.destination.options[i].text, form.destination.options[i].value);
}