Hi Friends,
I am developing an web application. here in an web form i need am using two radio buttons and two combo boxes say r1and r2 for radio and c1 and c2 for comboboxes.
Here my web form inherits from master page. I need to enable c1 when r1 is checked and c2 when r2 is checked.
i need to write javascript for this. how can i do this.
Regards
Rajath
Javascript for enabling and disabling combo boxes depending value of radiobutton
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Madhu KRank #1,514 · 1.1K reputationPosted Nov 24, 2010, 11:50 PM EST
{
if(document.getElementById("RadioButton1").checked==true)
{
alert("test");//enabe combo box.
}
}
rajath r30 reputationPosted Nov 25, 2010, 5:44 PM EST
It is not what i required my code is as follows:
Enable dropdown, disable textbox
Enable textbox, disable dropdown
Javascript is:
function abc()
{
if (document.form1.rbSelection[0].checked==true)
{
document.form1.dropdownlist.disabled=false;
document.form1.textbox.disabled=true;
}
else
{
document.form1.dropdownlist.disabled=true;
document.form1.textbox.disabled=false;
}
}
- My page inherits matster page. and above code is not working.
RegardsRajath