Reputation: 141
I made a script that onClick
shows/ hides a dropdown list here is the code.
HTML:
<input type="checkbox" name="user_choice" id="user_choice" onclick="checktoggle();"/>
<label for="user_choice">Show Map</label>
</br>
<select name="radius_out_map" id="radius_out_map" style="display:none">
<option value="0">-- Select Distance Radius --</option>
<option value="10">10 Km.</option>
<option value="20">20 Km.</option>
<option value="50">50 Km.</option>
<option value="100">100 Km.</option>
<option value="300">300 Km.</option>
<option value="500">500 Km.</option>
</select>
JAVASCTIPT :
<script language="javascript">
function checktoggle() {
var textboxid = document.getElementById('radius_out_map');
if (textboxid.style.display == 'none') {
textboxid.style.display = 'show';
}
else {
textboxid.style.display = 'none';
}
}
</script>
Why does this script not work?
Upvotes: 1
Views: 448
Reputation: 12431
Change
textboxid.style.display = 'show'
to
textboxid.style.display = 'block'
show is not valid.
Upvotes: 0