hello @LL, I have some dropdown <select name='selectedProd'> <option value='code1'>event 1,IL</option> <option value='code2'>event 2, IL</option> I want to create checkbox visible only if user picks event 1 from dropdown, but checkbox would not show up if event 2 will be selected. is that possible? thanks
You could do <input type="checkbox" id="mycheckbox" value="1"> <select onchange="javascript:checkDropdown(options[selectedIndex].value);" name="selectedProd"> </select> and then function checkDropdown(p_selected_value) { if (p_selected_value=="code1") { document.getElementById('mycheckbox').style.display='block'; } else { document.getElementById('mycheckbox').style.display='none'; } }
<select name='selectedProd' onchange="javascript: obj = document.getElementById('cb'); if(this.value=='code1') cb.style.display=''; else cb.style.display='none'; "> <option value='code1'>event 1,IL</option> <option value='code2'>event 2, IL</option> </select> <div id="cb" style="display:none"> <input type="checkbox"> my checkbox goes here </div> HTML: