Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    mantenere le scelte selezionate dopo il submit

    ciao,
    ho recuperato e personalizzato questo codice:
    codice:
    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);
            }
        }
    }
    al submit, mi resetta le scelte che evevo effettuato per il select 1 e 2
    come posso fare in modo che anche dopo il submit del form, mi rimangano selezionate le scelte?

    grazie mille

  2. #2

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.