Code:
<html>
	<head>
		<script type="text/javascript">
			function writeStuff(theform, theinput, code)
			{
				  var cache = document.theform.theinput.value;
				  document.theform.theinput.value = cache + " " + code + " ";
				  document.theform.theinput.focus();
			}
		</script>
	</head>
	<body>
		<form name="sform" method="post" action="">
		<textarea name="message" cols="15" rows="15"></textarea><br /><br />
		<input type="button" onClick="writeStuff('sform','message','STRING HERE');" name="" />
		</form>
	</body>
</html>
My problem when I click the button, it doesnt add 'STRING HERE' to the textarea, this function worked perfectly before I attempted to make it universal with some arguments like theform and theinput, can anyone give me a hint on whats wrong.