Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

onClick CheckBox unBlur Drop List

Status
Not open for further replies.

gu102

Technical User
May 5, 2002
7
US
As simple as this question is. I am a newbie, and need some functionality for a user. If they CHECK the checkbox then the DROP LIST on the right of it is enabled. if UNCHECKED then DISABLE.

Any help would be great. If you want to see how it looks cut-paste the below
---------------------------------------------------------
<form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;&quot;>
<input type=&quot;checkbox&quot; name=&quot;checkbox&quot; value=&quot;checkbox&quot;>
Check to Enable List / Uncheck to Disable
<select name=&quot;select&quot;>
<option value=&quot;0&quot; selected>Select Please</option>
<option value=&quot;1&quot;>1</option>
<option value=&quot;2&quot;>2</option>
<option value=&quot;3&quot;>3</option>
<option value=&quot;4&quot;>4</option>
<option value=&quot;5&quot;>5</option>
</select>
</form>
---------------------------------------------------------
 
<script language=&quot;javascript&quot;>
function enableDisable()
{
document.myform.mydropdown.disabled = !(document.myform.mydropdown.disabled);
}
</script>

<form action=&quot;&quot; method=&quot;post&quot; name=&quot;myform&quot;>
<input type=&quot;checkbox&quot; name=&quot;mycheckbox&quot; onclick=&quot;enableDisable();&quot;>
<select name=&quot;mydropdown&quot; size=&quot;1&quot; disabled>
<option value=&quot;&quot;>[Select]
<option value=&quot;Mr.&quot;>Mr.
<option value=&quot;Mrs.&quot;>Mrs.
<option value=&quot;Dr.&quot;>Dr.
</select>
</form>
....:::::.... xxLargeWASP ....:::::....
 
Sweet... works like a charm.
Is there any additional coding to make it Netscape 4.x compatable? if not then it's fine, the majority of the users are IE 5x + Up, only anout 5% are NS users. (*my site that is*)

Thanks
....:::::.... xxLargeWASP ....:::::....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top