Ciao a Tutti,
mi spiace non venire a capo di una condizione if che mi fa un po' arrabbiare ...![]()
Ho 2 menu' a tendina correlati,
vorrei che SOLO quando uno seleziona email1 nel primo menu',
e SOLO quando sceglie l' opzione "Free Text",
compaia a fianco del secondo menu' a tendina la label "Description" con relativa textarea
Adesso, quando uno sceglie email1,
per qualsiasi opzione del secondo menu' che sceglie, compare sempre la textarea ...
come mai ???![]()
Grazie come sempre in anticipo !!!
<head>
<Script Language="JavaScript">
var sum_db = new Object()
sum_db["email1"] = [{value:"I01 - Problemi di primo livello", text:"I01 - Problemi di primo livello"},
{value:"I02 - Problemi RDM", text:"I02 - Problemi RDM"},
{value:"Free Text", text:"Free Text "}];
sum_db["email2"] = [{value:"I03 - Varie", text:"I03 - Varie"}];
//
//
function setIssue(chooser) {
var newElem;
var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null;
var Iss_Chooser = chooser.form.elements["iss_sum"];
while (Iss_Chooser.options.length) {
Iss_Chooser.remove(0);
}
var choice = chooser.options[chooser.selectedIndex].value;
var db = sum_db[choice];
if (choice == "email1") {
newElem = document.createElement("option");
newElem.text = "Choose an issue ...";
newElem.value = "Choose Issue ...";
Iss_Chooser.add(newElem, where);
}
for (var i = 0; i < db.length; i++) {
newElem = document.createElement("option");
newElem.text = db[i].text;
newElem.value = db[i].value;
Iss_Chooser.add(newElem, where);
if ((choice == "email1") && (db[i].text.indexOf('Free Text')==0)) { document.getElementById("label_des").style.display =""; }
else { document.getElementById("label_des").style.display ="none"; }
}
}
//
</script>
</head>
<body>
<form>
<select size="1" name="mess" id="mess" onchange="setIssue(this)">
<option value="email1" selected>email1</option>
<option value="email2">email2</option>
</select>
....
....
<select id="iss_sum" name="iss_sum">
<option value="<%=objRS("Issue_Summary")%>" selected><%=objRS("Issue_Summary")%></option>
</select> <label for="iss_des" id="label_des" style="display:none; vertical-align:top">Description:<textarea id="iss_des" name="iss_des"><%=objRS("Issue_Description")%></textarea>
</label>