Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

How do I read textarea value ?

Posted on 2002-04-19
8
Medium Priority
?
2,379 Views
Last Modified: 2009-12-16
How do I read textarea value ?
0
Comment
Question by:tanc02
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 6954292
What do you mean? If you have a form named SomeForm and a textarea named SomeTextArea, you can access the value by:

strText=document.SomeForm.SomeTextArea.value
0
 
LVL 1

Author Comment

by:tanc02
ID: 6954308
but I got object required error.
0
 
LVL 1

Author Comment

by:tanc02
ID: 6954318
Sorry ! It is object expected.

Here is my code :

<form name="SomeForm">
<textarea name="SomeTextArea" rows=5 cols=50 onChange="javascript:setFlag()"></textarea>
<input type="button" value="Submit" onClick="tell()">
</form>

<script>
function tell(){
alert(document.SomeForm.SomeTextArea.value);
}
</script>
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 46

Accepted Solution

by:
fritz_the_blank earned 200 total points
ID: 6954332
Where is the setFlag()function?

Fritz the Blank
0
 
LVL 15

Expert Comment

by:a.marsh
ID: 6954334
Is that everything in the page?

Provide us with the whole page as there may be errors elsewhere having a knock-on effect.

Ant
0
 
LVL 1

Author Comment

by:tanc02
ID: 6954335
My mistake, I should not have setflag function.
0
 
LVL 15

Expert Comment

by:a.marsh
ID: 6954341
Paste this in to a page and you will see it works

<html>
<head>
<script language="javascript">
function tell(){
  alert(document.SomeForm.SomeTextArea.value);
}
</script>
</head>
<body>
<form name="SomeForm">
<p><textarea name="SomeTextArea">hello!</textarea></p>
<p><input type="button" value="click me!" onclick="tell();"></p>
</form>
</body>
</html>

It could be a problem with the setFlag() as fritz mentions.

We really need to see the whole page

:o)

Ant
0
 
LVL 15

Expert Comment

by:a.marsh
ID: 6954346
Glad you sorted it.

:o)

Ant
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

647 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question