How to add text to a textarea
Here is a simple test of the concepts I learned from that link:
Expand|Select|Wrap|Line Numbers
- <?xml version="1.0" encoding="iso-8859-1"?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <title>Textarea Test</title>
- <script type = "text/javascript">
- <!--
- function addtext( txt ) {
- document.myform.mytextarea.value += txt;
- }
- addtext( "I like cheese." );
- // -->
- </script>
- </head>
- <body bgcolor="#ffffff">
- <form name = "myform" onSubmit = "return false;">
- <label>Textarea:</label><br />
- <textarea name = "mytextarea" rows = "20" cols = "50"></textarea>
- </form>
- </body>
- </html>
Any ideas as to what I'm doing wrong?
Swaine77