Solved

How do I read textarea value ?

Posted on 2002-04-19
8
2,377 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
LVL 46

Accepted Solution

by:
fritz_the_blank earned 50 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

717 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