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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text not display in form field 2

Status
Not open for further replies.

annasue

Technical User
Mar 20, 2004
21
0
0
US
I have a php which takes input from a form. I do error-checking on what the user has keyed in; if there are problems, I re-display the form and populate the fields with what they originally keyed in. I have the program working with the exception of the "description" field which comes from a text area. Here is the form element:

<td width="300"><font face="Verdana, Arial, Helvetica, sans-serif">
<textarea rows="10" name="description" value="<?php echo $description ?>" cols="35" wrap="on"></textarea>
</font>

I can print "$description" just prior to the table and it is printing it just fine, but I can't get it to display itself in the form. Any answers?

Thanks in advance.
Anna Sue
 
try this
Code:
<td width="300">
<font face="Verdana, Arial, Helvetica, sans-serif">
<textarea rows="10" name="description" cols="35" wrap="on">
<?php echo $description ?>
</textarea>
</font>

hope this helps
 
Moonspell is right - this is a malformed HTML problem. The <textarea> tag has no value attribute but contains the content within the <textarea>content</textarea>.
It might be advantageous to use htmlentities or htmlspecialchars to ensure that an enclosed HTML tag will not break the output (a </textarea> tag typed in would do that....
 
This one was giving me a headache, too.
Works like charm now.
Thanks, Moonspell!
[thumbsup2]

Cheers,
Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top