View Full Version : Chained checkbox

08-09-2007, 06:55 PM
I was wondering how I could have a checkbox that when selected displayed a selection box with values.

If the checkbox was unchecked it would hide the selection box and then clear the value of the selection box.

Any ideas?

08-09-2007, 07:00 PM
Have a look at http://www.twey.co.uk/?q=forms.

08-09-2007, 07:07 PM
hmhmhm.... thats pretty cool.

I am looking for something a little more simple.

Just a checkbox, if selected it will show a selection box.

Unchecked the selection box disappears.

08-09-2007, 08:27 PM
<form action="">
<input type="checkbox" onclick="this.form.elements['myselect'].display = this.checked ? '' : 'none';">
<select name="myselect">
<option>An option</option>
<option>Another option</option>