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>