...

View Full Version : making combo box visible/hidden



gingerGamgee
01-16-2004, 09:27 PM
I would like to know how I can make a combo box visible or not visible depending on the selection in another combo box.

Like...
<select>
<OPTIONvalue="Y">Yes</OPTION>
<OPTIONvalue="N">No</OPTION></SELECT>



if "Yes" was selected, the combo box would become visible ...if it was "no" the combo box would stay hidden.

Thanks!

Danne
01-16-2004, 09:37 PM
...

function setVisible(pShow) {
document.getElementById("id_of_the_other_select").style.display=(pShow ? "block" : "none");
}

</script>

...

<select onchange="setVisible(this.options[this.selectedIndex].value);">
<option value="1">Yes</option>
<option value="0">No</option>
...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum