Seems more of a JavaScript question than a MySQL/PHP question. The following will do what you want to do in javascript
:
HTML Code:
<html>
<head>
<script language="JavaScript" type="text/javascript">
function showhide(spanname) {
<!-- This function shows/hides a span when its button is clicked. -->
<!-- It changes the css display property. -->
if (document.getElementById(spanname).style.display=="") {
document.getElementById(spanname).style.display="none"; <!-- for some reason, this forum post system keeps adding a space in the "none" value here. Make sure to take this space out before you use it! -->
}
else if (document.getElementById(spanname).style.display=="none"){
document.getElementById(spanname).style.display="";
}
}
</script>
</head>
<body>
<span id="txtArea1">
<textarea rows="10" cols="20">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi faucibus. Aenean lectus orci, euismod a, auctor a, porta non, dui.
</textarea>
</span>
<br/>
<button onClick="javascript: showhide('txtArea1');">Click Me!</button>
</body>
</html>
==================================
- Put the showhide function in the head
- Wrap your textarea with a span tag
- "id" the span tag
- Insert the onClick attribute on the submit button with the JavaScript call (make sure to change the parameter!)