Hi to All,
I have 3 menus.
In the first menu I select an email adress.
According to the email selected, in the second menu appears a problem list with an option called “Free Text”
I would like that,
ONLY when a user choose email1 with the second option “Free Text”,
OR when a user choose email2 with the unique option of “Free Text”,
in the third menu appears the voice “Choose priority …” with the other two options: urgent, normal ..
With this code, now the goal is ok only for email1,
with email2 happens nothing … ?
Thanks a lot in advance !!!
<head>
//
var summary_db = new Object()
var prior_db = new Object()
summary_db[“email1″] = [{value:”Problems of 1 level, text:”Problems of 1 level”},
{value:”Problems of schedule”, text:”Problems of schedule”},
{value:”Free Text”, text:”Free Text”}];
summary_db[“email2″] = [{value:”Free Text”, text:”Free Text”}];
prior_db[“Problems of 1 level”] = [{value:”2 hours”, text:”2 hours”}];
prior_db[“Problems of schedule”] = [{value:”4 hours”, text:”4 hours”}];
prior_db[“Free Text”] = [{value:”Normal (5 days)”, text:”Normal (5 days)”},{value:”Urgent (1 day)”, text:”Urgent (1 day)”}];
//
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 = summary_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);
}
}
//
function setPriority(chooser) {
var newElem;
var where = (navigator.appName == “Microsoft Internet Explorer”) ? -1 : null;
var prChooser = chooser.form.elements[“priority”];
while (prChooser.options.length) {
prChooser.remove(0);
}
var choice = chooser.options[chooser.selectedIndex].value;
var db = prior_db[choice];
if (choice==”Free Text”) {
newElem = document.createElement(“option”);
newElem.text = “Choose priority …”;
newElem.value = “Choose priority …”;
prChooser.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;
prChooser.add(newElem, where);
}
}
//
</script>
</head>
<body>
<form method=”POST” webbot-onSubmit language=”JavaScript” name=”FrontPage_Form1″>
<select name=”mess” id=”mess” onchange=”setIssue(this)”>
<option value=”<%=objRS(“Mess”)%>” selected><%=objRS(“Mess”)%></option>
<option value=”email1″>Mail 1</option>
<option value=”email2″>Mail 2</option>
</select>
<select id=”iss_sum” name=”iss_sum” onchange=”setPriority(this)”>
<option value=”<%=objRS(“Summary”)%>” selected><%=objRS(“Summary”)%></option>
</select>
<select name=”priority” id=”priority”>
<option value=”<%=objRS(“Priority”)%>” selected><%=objRS(“Priority”)%></option>
</select>
</body>