Forum Moderators: open
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<script type="text/javascript">
function setOptions(chosen, selbox) {
selbox.options.length = 0;
if (chosen == " ") {
selbox.options[selbox.options.length] = new Option('Select Your Sport',' ');
setTimeout(setOptions('Blank',document.myform.optthree),5);
}
if (chosen == "1") {
selbox.options[selbox.options.length] = new Option('Football','Bob - Football');
selbox.options[selbox.options.length] = new Option('Hockey','Bob - Hockey');
selbox.options[selbox.options.length] = new Option('Tennis','Bob - Tennis');
setTimeout(setOptions('Bob',document.myform.optthree),5);
}
if (chosen == "2") {
selbox.options[selbox.options.length] = new Option('Football','Fred - Football');
selbox.options[selbox.options.length] = new Option('Hockey','Fred - Hockey');
selbox.options[selbox.options.length] = new Option('Tennis','Fred - Tennis');
setTimeout(setOptions('Fred',document.myform.optthree),5);
}
if (chosen == "3") {
selbox.options[selbox.options.length] = new Option('Football','Sam - Football');
selbox.options[selbox.options.length] = new Option('Hockey','Sam - Hockey');
selbox.options[selbox.options.length] = new Option('Tennis','Sam - Tennis');
setTimeout(setOptions('Sam',document.myform.optthree),5);
}
if (chosen == "Bob") {
selbox.options[selbox.options.length] = new Option('Bob Only Has One Leg, Would Football Be A Wise Choice?',' ');
}
if (chosen == "Fred") {
selbox.options[selbox.options.length] = new Option('Fred Has No Arms, Would Tennis Be A Wise Choice?',' ');
}
if (chosen == "Sam") {
}
}
</script>
<BODY>
<TABLE>
<TD Width="300"><BR><form name="myform">
<select name="optone" size="1" onchange="setOptions(document.myform.optone.options[document.myform.optone.selectedIndex].value,document.myform.opttwo);">
<option value=" " selected="selected">Select Your Name</option>
<option value="1">Bob</option>
<option value="2">Fred</option>
<option value="3">Sam</option>
</select>
<select name="opttwo" size="1" onchange="setOptions(document.myform.opttwo.options[document.myform.opttwo.selectedIndex].value,document.myform.optthree);">
<option value=" " selected="selected">Select Your Sport</option>
</select></td><td>
<select name="optthree" size="1">
<option value=" " selected="selected">Question</option>
</select></td><tr><td></td><td align=center>
<input type="button" name="go" value="Value Selected" onclick="alert(document.myform.opttwo.options[document.myform.opttwo.selectedIndex].value);" />
</form>
</TD>
</TABLE>
<TABLE><TD WIDTH="600"><BR><BR><B>My question:</B><BR>
I need to be able to have a "question" area (above the submit) but instead it being a dropdown box, I would like it just to be plain text within a table cell.<BR><BR>For example: when you select "Bob" in the name dropdown box I've configured the question area to ask a question. As Bob only has one leg would it be wise to place Bob in Football? Which is good, that is what I want it to do, but when selecting a sport for him it disappears (not good I want it to stay there).<BR><BR>Same happens when selecting Fred, Fred has no arms, no arms would not be good for Tennis etc... But when selecting Sam, no questions are asked because Sam has the ability to play all sports.<BR><BR>I have my options form submit to just do the name and the sport, I have that correct so no hassles there.<BR><BR>Just need to keep the question area active all the time (when applicable) but also instead of in a dropdown box be placed as text within a table cell.
</BODY></HTML>