Ciao a tutti. io ho questo script che funziona perfettamente e non fa altro che visualizzare un menu con campo textbox dinamico. vorrei fare in modo che cliccando su un tasto venga riproposto sotto di questo un medesimo menù identico e così via x 4 volte, ovviamente i dati devono essere successivamente salvati su un database.
sinceramente non so come fare .... help me ????
<html><head>
<script type="text/javascript">
var regiondb = new Object()
regiondb["africa"] = [{value:"102", text:"ciao1"},
{value:"88", text:"ciao1"},
{value:"80", text:"ciao1"},
{value:"55", text:"ciao1"}];
regiondb["asia"] = [{value:"30", text:"ciao2"},
{value:"21", text:"ciao2"},
{value:"49", text:"ciao2"},
{value:"76", text:"ciao2"},
{value:"14", text:"ciao2"}];
regiondb["australia"] = [{value:"64", text:"ciao3"},
{value:"12", text:"ciao3"}];
regiondb["europa"] = [{value:"11", text:"ciao4"},
{value:"35", text:"ciao4"},
{value:"3", text:"ciao4"},
{value:"15", text:"ciao4"},
{value:"1", text:"ciao4"},
{value:"10", text:"ciao4"},
{value:"6", text:"ciao4"},
{value:"97", text:"ciao4"}];
regiondb["noamer"] = [{value:"73", text:"ciao5"},
{value:"71", text:"ciao5"},
{value:"5", text:"ciao5"},
{value:"37", text:"ciao5"}];
regiondb["suamer"] = [{value:"65", text:"ciao6"},
{value:"31", text:"ciao6"},
{value:"66", text:"ciao6"}];
function setCities(chooser) {
var newElem;
var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null;
var cityChooser = chooser.form.elements["città"];
while (cityChooser.options.length) {
cityChooser.remove(0);
}
var choice = chooser.options[chooser.selectedIndex].value;
var db = regiondb[choice];
newElem = document.createElement("option");
newElem.text = "Seleziona una sottocategoria";
newElem.value = "";
cityChooser.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;
cityChooser.add(newElem, where);
}
}
}
</script></head>