Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<textarea> tag does it have a value attribute

Status
Not open for further replies.
Feb 9, 2001
10
0
0
US
I trying to have the <textarea> to be already popluate with text that the user can edit if they want. Is there anyway I can do that? I tried value=&quot;variablename&quot; but that didn't work. The variable name holds the text I want to display.
Thanks in advanced.
:)
 
<textarea name=&quot;textfield&quot;>blahblahblah
</textarea>

;-)
 
You could probably do it with javascript.

In the heading give the variable a value:
<head>
<script language=&quot;JavaScript&quot;>
varname=&quot;value&quot;
</script>
</head>

And then in the html, put something similar to this where you want the textarea to display:
<script language=&quot;JavaScript&quot;>
document.write(&quot;<textarea>&quot;)
document.write(varname)
document.write(&quot;</textarea>&quot;)
</script>

I'm sure there's probably an easier way to do it, but maybe this will get you on the right track...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top