0% found this document useful (0 votes)
101 views1 page

Hideshow Button Using Jquery

Hide / Show button and change textarea as readonly Hi friends, Most of the webdevelopers faceing the situation like this.Some times we need to make the text area as editable one when they are going to click the button.We can easily make it by using the javascript.

Uploaded by

TechnoTiger
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
Download as doc, pdf, or txt
0% found this document useful (0 votes)
101 views1 page

Hideshow Button Using Jquery

Hide / Show button and change textarea as readonly Hi friends, Most of the webdevelopers faceing the situation like this.Some times we need to make the text area as editable one when they are going to click the button.We can easily make it by using the javascript.

Uploaded by

TechnoTiger
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1/ 1

Hide/Show button and change textarea as readonly

Hi friends,
Most of the webdevelopers faceing the situation like this.Some times we need to make
the text area as editable one when they are going to click the button.We can easily make
it by using the javascript.Here I am explaining with the check box.When the user going to
click the check box its going to be readonl.Because first it is the editable one.You can
make it also in reverse.
For that you put readonly as true in HTML and change the readonly as false in javascript.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<script type="text/javascript">

function blah(bool) {
if(bool) {
document.getElementById("ta").readOnly = true;
document.getElementById('tst').style.visibility = 'visible'
}
else {
document.getElementById("ta").readOnly = false;
}
}

</script>

<textarea id="ta" ></textarea>


<input type="checkbox" onclick="blah(this.checked)" />
<div id="tst" style="visibility:hidden"><input type="button" value="save"/></div>
</body>
</html>

Leave the comments to improve us....

please visit http://technotiger87.blogspot.com for more information

You might also like