Oct 24, 2002 #1 sickpuppy Technical User Feb 22, 2001 40 GB I am trying to use a form to pass through values to an .asp page. I have 2 drop down lists and wish for the second to only be selectable depending on the value selected on the first. Can anyone help?
I am trying to use a form to pass through values to an .asp page. I have 2 drop down lists and wish for the second to only be selectable depending on the value selected on the first. Can anyone help?
Oct 24, 2002 1 #2 jemminger Programmer Jun 25, 2001 3,453 US sure: [tt] var first = document.forms[0].[firstSelectListName]; var second = document.forms[0].[secondSelectListName]; if (first.selectedIndex == [unacceptableValue]) { second.disabled = true; } else { second.disabled = false; } [/tt] ========================================================= if (!succeed) try(); -jeff Upvote 0 Downvote
sure: [tt] var first = document.forms[0].[firstSelectListName]; var second = document.forms[0].[secondSelectListName]; if (first.selectedIndex == [unacceptableValue]) { second.disabled = true; } else { second.disabled = false; } [/tt] ========================================================= if (!succeed) try(); -jeff
Oct 24, 2002 1 #3 starway Programmer Jan 15, 2002 1,010 UA function onOff(s) { if (!s.options[0].selected) document.f1.s2.disabled = true else document.f1.s2.disabled = false } <form name="f1"> <select name="s1" onchange="onOff(this)"> <option>2nd ON <!-- the 1st option should enable 2nd select list --> <option> . . . <select name="s2"> Upvote 0 Downvote
function onOff(s) { if (!s.options[0].selected) document.f1.s2.disabled = true else document.f1.s2.disabled = false } <form name="f1"> <select name="s1" onchange="onOff(this)"> <option>2nd ON <!-- the 1st option should enable 2nd select list --> <option> . . . <select name="s2">
Oct 29, 2002 Thread starter #4 sickpuppy Technical User Feb 22, 2001 40 GB cheers for that. Allsorted now Upvote 0 Downvote
Oct 30, 2002 #5 susan17 Programmer Nov 6, 2001 12 SG Setting the value of disabled = true or false doesn't work in Netscape, though. Anybody has any solution for this? Upvote 0 Downvote
Setting the value of disabled = true or false doesn't work in Netscape, though. Anybody has any solution for this?