Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1517 Is there a way to make a select list visible or hidden or at least disbaled depending on what radio button is checked?

You are here: irt.org | FAQ | JavaScript | Form | Q1517 [ previous next ]

The most compatible (only Internet Explorer can hide and show form elements easily) is the following:

<form>
<select name="mySel" onChange="if (this.disabled) this.selectedIndex=0">
.
.
.
</select>
<input type="radio" name="r1" onClick="this.form.mySel.disabled=true">disable
<input type="radio" name="r1" onClick="this.form.mySel.disabled=false">enable
</form>

Feedback on 'Q1517 Is there a way to make a select list visible or hidden or at least disbaled depending on what radio button is checked?'

©2018 Martin Webb