Hello Gang!
I have a bit of a troublesome spot. I am working on a web page for an instructional course. The user reads a scenario, and then in a text field types their response. What I want to have is a button which says “Check” below the text field which will THEN show a textfield which already has a paragraph of the appropriate answer in it. I have code I found on another reference site, but it does the reverse… the text box is visible right away and you click on a text link to make the box be hidden. Can someone please help modify my code so the textarea is hidden initially and shows when the user clicks the check button?
[CODE]
<script type=”text/javascript”>
function hide(status) {
if (status == “hidden”) {
document.getElementById(“textbox”).style.visibility = “hidden”;
document.getElementById(“button”).innerHTML = “<a onclick=”hide(‘show’)” href=”#”>Show Textbox</a>”;
}
else {
document.getElementById(“textbox”).style.visibility = “visible”;
document.getElementById(“button”).innerHTML = “<a onclick=”hide(‘hidden’)” href=”#”>Hide Textbox</a>”;
}
}
</script>
[code=html]
<span id=”button”>
<a onclick=”hide(‘hidden’)” href=”#”>Hide Textbox</a>
</span>
<textarea cols=”32″ rows=”8″ id=”textbox” name=”Answer” >Use the internal reporting chain of command. You should immediately bring this to the attention fo your supervisor. If the situation does not seem to be addressed, you should report it to the next higher level supervisor, contact your CBI Officer, or call the CBI helpLIne.</textarea>
Any help is greatly appreciated!
Thanks!
~metallifan15