Click here to Skip to main content
15,905,616 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
i have html page <input type="text"> containg in this page when i load this page it will disable that mean the data couldnot be editable and the edit button click time the all data show enable edit..how it set?
Posted

try this

C#
protected void Page_Load(Sender object,EventArgs e)
{
 If(!Page.IsPostBack)
   {
    textBox1.Enabled=False;
    //textBox1.ReadOnly=True;//optional
   }

}
protected void BtnEdit_Click(Sender object,EventArgs e)
{
 textBox1.Enabled=True;
 //textBox1.ReadOnly=False;//optional 

}


please read this article for jquery function
 
Share this answer
 
v2
Comments
[no name] 19-Feb-14 9:58am    
how to hide a option value using jquery?
The14thNoah 19-Feb-14 19:21pm    
try this
$("button").click(function(){
$("#TextBox1").hide();
});
Krunal Rohit 19-Feb-14 21:32pm    
by the way, it's the object sender.
:))
-KR
Hi...
C#
$(document).ready(function(){      
    $("input#btn").click(function(){
      $("input#txt").hide();
    });
});

<input type="text" id="txt" />
<input type="button" id="btn" value="Click Me" onclick="$('#txt').hide()"/>

Thank u.
 
Share this answer
 
In the page load event use this code
C#
textBox1.Enabled=False;
 
Share this answer
 
$(document).ready(function(){
$("#txt"}.enabled=false;
);

function Enabletextbox()
{
$("#txt"}.enabled=true;
}

 
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