...

View Full Version : javascript that adds to a text area



shane.carr
06-01-2006, 11:12 PM
Okay, I have a problem that should be simple. What is the javascript that adds the contents of a string to a text area? Even better, is there html to do that?

shane.carr
06-01-2006, 11:32 PM
Nevermind, I found a way.



<html>
<script language="javascript">
<!--
function addtotextarea(what) {
document.form.test.value = document.form.test.value + what
}
// -->
</script>
<body>
<form name="form">
<textarea name="test"></textarea>
</form>
<button onclick="addtotextarea('hi');">Hi</button>
</body>
</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum