Navigazione

    Privacy - Termini e condizioni
    © 2020 Search On Media Group S.r.l.
    • Registrati
    • Accedi
    • CATEGORIES
    • Discussioni
    • Non letti
    • Recenti
    • Hashtags
    • Popolare
    • Utenti
    • Stream
    • Interest
    • Categories
    1. Home
    2. kermi136
    3. Post
    K

    kermi136

    @kermi136

    • Profilo
    • Chi segue 0
    • Da chi è seguito 0
    • Discussioni 0
    • Post 1
    • Migliore 0
    • Gruppi 0
    Iscrizione Ultimo Accesso
    Età 45
    0
    Reputazione
    1
    Post
    0
    Visite al profilo
    0
    Da chi è seguito
    0
    Chi segue
    User Newbie

    Post creati da kermi136

    • RE: [javascript] problemino con le select dinamiche

      ciao, ho popolato la mia pagina con php da un DB. il risultato e' praticamente uguale a quello discusso nel thread.
      solo che non funziona e non riesco capire dove sbaglio. aiuto..
      vi posto il codice:

      
      
      <script type="text/javascript">
      var dati = new Objetc() 
      dati["2010-06-26"] = [ {value:"0", text:"08:00:00"} ];
      dati["2010-06-27"] = [ {value:"1", text:"08:20:00"}, {value:"2", text:"08:00:00"} ];
      dati["2010-06-28"] = [ {value:"3", text:"08:20:00"} ];
      dati["2010-08-28"] = [ {value:"4", text:"21:20:00"} ];
      
      function setSlot(chooser) {
          var newElem;
          var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 :    null; 
          var slotChooser = chooser.form.elements["slot"];
          while (slotChooser.options.length) {
              slotChooser.remove(0);
          }
          var choice = chooser.options[chooser.selectedIndex].value;
          var db = dati[choice];
          newElem = document.createElement("option");
          newElem.text = "seleziona uno slot:";
          newElem.value = "";
          slotChooser.add(newElem, where);
          if (choice != "") {
              for (var i = 0; i < db.length; i++) {
                  newElem = document.createElement("option");
                  newElem.text = db*.text;
                  newElem.value = db*.value;
                  slotChooser.add(newElem, where);
              }
          }
      }
        
      
      </script>
      <table>
       <form action="" method="post" name="frmCart" id="frmCart">
      Data:
      <select name="data" onchange="setSlot(this)">
      <option value="" selected="selected">data</option>
      <option value="2010-06-26">2010-06-26</option>
      <option value="2010-06-27">2010-06-27</option>
      <option value="2010-06-27">2010-06-27</option>
      <option value="2010-06-28">2010-06-28</option>
      <option value="2010-08-28">2010-08-28</option>
      
      </select>
      </td></tr>
      <tr><td colspan="8">
      Slot:
      <select name="slot" onchange="this.form.submit();">
      <option value="" selected="selected">Seleziona uno slot</option>
      </select>
      </form>
      </table>
      
      
      
      
      
      postato in Coding
      K
      kermi136