ciao,
ho recuperato e personalizzato questo codice:
al submit, mi resetta le scelte che evevo effettuato per il select 1 e 2codice:var shipping = new Object() shipping["1"] = [{value:"1", text:"Carta"}, {value:"2", text:"Contrassegno"}, {value:"3", text:"Bollettino"}]; shipping["2"] = [{value:"1", text:"Carta"}, {value:"4", text:"Bonifico"}]; shipping["3"] = [{value:"1", text:"Carta"}, {value:"4", text:"Bonifico"}]; function setCost(chooser) { var newElem; var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null; var costChooser = chooser.form.elements["id_pag"]; while (costChooser.options.length) { costChooser.remove(0); } var choice = chooser.options[chooser.selectedIndex].value; var db = shipping[choice]; newElem = document.createElement("option"); newElem.text = "tipo di pagamento:"; newElem.value = ""; costChooser.add(newElem, where); if (choice != "") { for (var i = 0; i < db.length; i++) { newElem = document.createElement("option"); newElem.text = db[i].text; newElem.value = db[i].value; costChooser.add(newElem, where); } } }
come posso fare in modo che anche dopo il submit del form, mi rimangano selezionate le scelte?
grazie mille

Rispondi quotando