Kaur Kaur - 1 year ago 49
jQuery Question

Is there any to hide the radio buttons but not the drop down list?

I have two radio buttons that I want to hide and just give the drop down list to the users to select from. Is it possible to hide the radio buttons completely without hiding the drop down list?

hides the dd list too.

<td><input type="radio" name="UseAllCodes" value="yes" checked onClick="attReset();"> All<br>
<input type="radio" name="UseAllCodes" value="no" onClick="attReset();" id="theseCodes"> These codes <br>
<select name="handpick" onChange="attToggleAndReset();" size="10" multiple>
<option value="25248692">Code 1
<option value="25248693">Code 2

Answer Source

If you can't change the original HTML, but you don't mind removing the radio buttons, rather than hiding them, you could do the following:

var $select = $("[name=handpick]");
var $cell = $select.parent();

This detaches the select element, then clears out the table cell, and finally puts the select element back.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download