Click here to Skip to main content
15,884,237 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends,
How to make a textbox readonly and editable on the basis of a condition? Suppose I want the following thing to do:
C#
if(condition true)
{
    textbox should be readonly
}
else{
     textbox should be editable
}

How to do this?
Posted
Updated 23-Apr-11 7:15am
v3
Comments
Sandeep Mewara 23-Apr-11 13:15pm    
Not sure on what is to be asked here or what must be stopping you.

1 solution

Put the following code in your conditions -

document.form1.txt1.disabled=true;
document.form1.txt1.readonly=true;
 
Share this answer
 
v2

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