Solved

Loading Text into a TEXTAREA

Posted on 1998-08-17
8
190 Views
Last Modified: 2010-04-09
I have defined a TEXTAREA in IE3 and want to pass text to that textarea.

So far I have the following (which works in IE4)

<SCRIPT>
{
var s0 = "Text Var zero. "
var s1 = "Text Var one. "
var s2 = "Text Var two. "
}</SCRIPT>

and in the body -

<TEXTAREA NAME="box" ROWS="6" COLS="53" WRAP="VIRTUAL"></TEXTAREA>

I thought that if I called "box.value = s0; " it would pass "Text Var zero." to the TEXTAREA.

It does in IE4 but in IE3 I get a  "'box' is undefined" error

Any ideas??
0
Comment
Question by:cmuir
8 Comments
 
LVL 4

Expert Comment

by:martinag
ID: 1836761
<FORM NAME="form">
<TEXTAREA NAME="box" ROWS="6" COLS="53" WRAP="VIRTUAL"></TEXTAREA>
</FORM>

Reference to box using document.form.box ie
document.form.box.value = s0;

Martin
0
 

Author Comment

by:cmuir
ID: 1836762
Tried document.form.box.value No error msg
But
TEXTAREA remains blank!
0
 
LVL 4

Expert Comment

by:martinag
ID: 1836763
Strange...
Maybe that you can not set the text, just read it.
Try this:
alert(document.form.box.value);

Does it display the text in the TEXTAREA?

Martin
0
 
LVL 4

Expert Comment

by:martinag
ID: 1836764
Found this in the documentation:

The value property is a string that initially reflects the VALUE attribute. This string is displayed in the text and textarea fields. The value of this property changes when a user or a program modifies the field.

You can set the value property at any time. The display of the text and textarea objects updates immediately when you set the value property.

Maybe there is a bug in IE3? That is where the problem occurs, right?
I guess your script still works in IE4.

Martin
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 10

Accepted Solution

by:
MasseyM earned 20 total points
ID: 1836765
Here you go, this works:

*************************************

<SCRIPT>
{
var s0 = "Text Var zero. " 
var s1 = "Text Var one. " 
var s2 = "Text Var two. " 
}</SCRIPT>

<FORM Name="Name">
<TEXTAREA NAME="box" ROWS="6" COLS="53" WRAP="VIRTUAL">
</TEXTAREA>
<A HREF="javascript:GoText()">Click Me</A>

<SCRIPT>
function GoText(){
document.Name.box.value = s0

}
</SCRIPT>
</FORM>

******************************************
0
 
LVL 4

Expert Comment

by:martinag
ID: 1836766
MasseyM,
exactly which part of that answer did you come up with by yourself?
The only new thing is the name of the form.

Martin
0
 
LVL 8

Expert Comment

by:jbirk
ID: 1836767
Get used to it martinag.  MasseyM does this all the time.

The only thing I can think of which may fix this is changing the names in the off chance that form or box are reserved in IE 3 for some unknown reason and are causing a problem.  Otherwise it's just an error in the browser, and yet another good reason for IE 3 users to download a real browser!
-Josh
0
 
LVL 4

Expert Comment

by:martinag
ID: 1836768
Thanks for the advice...

Martin
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Summernote and form validation 10 97
Bootstrap more than 12 columns in row 3 37
Need to click button twice to get results 2 32
Objects on Same Line 2 18
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

910 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now