...

View Full Version : Confused on getting input from textarea



Rune Hunter
11-05-2004, 04:08 AM
I want to get the text from a textarea and put it into a variable. How do I do this because eval didn't work for me.

AaronW
11-05-2004, 04:12 AM
<textarea id="txtArea"></textarea>
...
<script type="text/javascript">
txt = document.getElementById ('txtArea').value;
alert ('Text in text area: ' + txt);
</script>

Willy Duitt
11-05-2004, 04:12 AM
var myVariable = document.forms['myFormName']['myTextareaName'].value;

.....Willy

Rune Hunter
11-05-2004, 08:43 PM
Those still don't work.

Willy Duitt
11-05-2004, 09:45 PM
Those still don't work.

Can't tell from here...
Obviously you are doing something wrong...
Or do you think it is us that steered you wrong... :rolleyes:

.....Willy

Roy Sinclair
11-05-2004, 10:36 PM
In case you don't understand the sarcasm: If you want useful help it's a really good idea to post a link to the defective code or at least post that code here so we can examine it for problems. We are not clairvoyant so we can't magically look over your shoulder, you have to give us something "real" to work with.

See the link labeled "Posting Guidelines" for more information.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum