I got 2 radiobutton and 1 radcombobox
<asp:RadioButton ID="cbxYes" Width="60" Height="30" runat="server" GroupName="proffesional" OnCheckedChanged="cbxYes_CheckedChanged" />
<asp:RadioButton ID="cbxNo" runat="server" Width="60" Height="30" GroupName="proffesional" Checked="true" OnCheckedChanged="cbxNo_CheckedChanged" />
<telerik:RadComboBox ID="dblSelect" EnableEmbeddedSkins="false" BackColor="Black" ForeColor="#d8d8d8" runat="server" Width="200" Height="30" ></telerik:RadComboBox>
. don't use clientidmode=static
and i want to show or hide radcombobox according what radiobutton is checked.
I have written this code:
<script type="text/javascript">
$(document).load(function () {
var dropdown = $('#<%= dblSelect.ClientID%>');
var radio1 = $('#<%= cbxYes.ClientID%>');
var radio2 = $('#<%= cbxNo.ClientID%>');
if ((radio1.is(':checked').val()) == 'true') {
dropdown.is(':visible').val() = 'true';
};
if((radio2.is(':checked').val() == 'false'){
dropdown.is(':visible').val() = 'false';
};
});
</script>
What am I doing wrong?
Thanks in advance :)
jQuery's is
returns a boolean.
if (radio1.is(':checked')) {
dropdown.show();
};
if(radio2.is(':checked')){
dropdown.hide();
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With