tanc02
asked on
How do I read textarea value ?
How do I read textarea value ?
ASKER
but I got object required error.
ASKER
Sorry ! It is object expected.
Here is my code :
<form name="SomeForm">
<textarea name="SomeTextArea" rows=5 cols=50 onChange="javascript:setFl ag()"></te xtarea>
<input type="button" value="Submit" onClick="tell()">
</form>
<script>
function tell(){
alert(document.SomeForm.So meTextArea .value);
}
</script>
Here is my code :
<form name="SomeForm">
<textarea name="SomeTextArea" rows=5 cols=50 onChange="javascript:setFl
<input type="button" value="Submit" onClick="tell()">
</form>
<script>
function tell(){
alert(document.SomeForm.So
}
</script>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Is that everything in the page?
Provide us with the whole page as there may be errors elsewhere having a knock-on effect.
Ant
Provide us with the whole page as there may be errors elsewhere having a knock-on effect.
Ant
ASKER
My mistake, I should not have setflag function.
Paste this in to a page and you will see it works
<html>
<head>
<script language="javascript">
function tell(){
alert(document.SomeForm.So meTextArea .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
<html>
<head>
<script language="javascript">
function tell(){
alert(document.SomeForm.So
}
</script>
</head>
<body>
<form name="SomeForm">
<p><textarea name="SomeTextArea">hello!
<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
Glad you sorted it.
:o)
Ant
:o)
Ant
strText=document.SomeForm.