Click here to Skip to main content
15,897,718 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
I am trying to write code so that selecting a radio button will desable a textbox. The default state of the textbox should be enable. Any ideas how I should code this?
i am beginner
Posted

A new semester has started. One of your classmates beat you to it. Go here for the answer:

How to implement the code[^]
 
Share this answer
 
Comments
Ankur\m/ 5-May-11 8:01am    
It's the same guy. He has many id's ending with 2. I caught him some days back for the same thing.
On Page_Load set the RadioButtons AutoPostback Property to true.

protected void RadioButton1_CheckedChanged(object sender, EventArgs e)
{
Response.Write(RadioButton1.Checked);
if (RadioButton1.Checked)
{
RadioButton1.Checked = true;
TextBox2.Enabled = true;
}
}
 
Share this answer
 
Comments
#realJSOP 5-May-11 7:54am    
READ the question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900