Click here to Skip to main content
15,881,559 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi dears.
I have 2 radiobutton & one textbox in my form.
I want if user select first radio button the textbox be available and if user select second radio button the textbox be notavailable.
Posted
Comments
Rahul Rajat Singh 4-Aug-12 4:08am    
Do you want to do this on client side or server side?
[no name] 4-Aug-12 7:23am    
So go ahead and do it.

hi,

check this..
http://asp-net-example.blogspot.in/2009/03/how-to-use-oncheckedchanged-event-in.html[^]

understand the usage and do it accordingly.
 
Share this answer
 
Hi .
check tis code:
C#
if (RadioGender.SelectedValue=="RadioButtonName")
{
    textbox1.Enabled = true;
}
else
{
    TextBox2.Enabled = true;
}




==if it is helpful please vote==
 
Share this answer
 
This code may be help you properly

C#
private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton1.Checked == true)
            {
                textBox1.Enabled = true;
            }
            else
            {
                textBox1.Enabled = false;
            }
            /********or********/
            textBox1.Enabled = radioButton1.Checked;
            ///////////////////
        }


Be Coding with joy.
 
Share this answer
 

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