connectseekers.com

Wednesday, 12 October 2016

Make Textbox From Readonly to Editable in jQuery

10/12/2016 - By Pranav Singh 0

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.

  <input type="text" disabled="disabled" id="txtName" /><br /><br />
    <input type="button" value="Submit"/>

After this we will use the below code to make the jquery code.

    <script>
        function EnableTextBox() {
            $("#txtName").removeAttr("disabled");
        }
    </script>

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. 

<!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> 

Now check the output.


About the Author

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Get Updates

Subscribe to our e-mail newsletter to receive updates.

Share This Post

0 comments:

Please let me know your view

Free Ebooks


About Us

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Contact Us

For writing article in this website please send request by your

GMAIL ID: dotnetpools@gmail.com
Email Id : contact@aspdotnet-pools.com

Bugs and Suggestions

As we all know that this website is for sharing knowledge and providing proper solution. So while reading the article is you find any bug or if you have any suggestion please mail us at contact@aspdotnet-pools.com.

Partners


Top jQuery Plugins

Global Classified : Connectseekers.com
© 2014
back to top