This article will show you how you can make a textbox control from read only mode to editable mode on button click using jquery.
Foo this first we will take a textbox and a button control.
After this we will use the below code to make the jquery code.
Here in above code i have passed the textbox control which we are going to make enable. Now call the above code on button click event.
Now check the output.
Foo this first we will take a textbox and a button control.
<input type="text" disabled="disabled" id="txtName" /><br /><br />
<input type="button" value="Submit"/>
|
<script>
function EnableTextBox() {
$("#txtName").removeAttr("disabled");
}
</script>
|
<!DOCTYPE html>
<html>
<head>
<title>Make textbox from
readonly to editable in jquery</title>
<script src="../Scripts/jquery-1.10.2.js"></script>
<script>
function EnableTextBox() {
$("#txtName").removeAttr("disabled");
}
</script>
</head>
<body>
<input type="text" disabled="disabled" id="txtName" /><br /><br />
<input type="button" value="Submit" onclick="javascript:
EnableTextBox();" />
</body>
</html>
|
0 comments:
Please let me know your view