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

Toggle Textarea Readonly with JavaScript

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)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
133 views1 page

Toggle Textarea Readonly with JavaScript

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)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

Hide/Show button and change textarea as readonly

Hi friends,
Most of the webdevelopers faceing the situation like [Link] times we need to make
the text area as editable one when they are going to click the [Link] can easily make
it by using the [Link] I am explaining with the check [Link] the user going to
click the check box its going to be [Link] first it is the editable [Link] 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"


"[Link]
<html xmlns="[Link]
<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) {
[Link]("ta").readOnly = true;
[Link]('tst').[Link] = 'visible'
}
else {
[Link]("ta").readOnly = false;
}
}

</script>

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


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

Leave the comments to improve us....

please visit [Link] for more information

You might also like