At 4:47 PM -0500 1/23/01, Shane McBride wrote:
>I have a field in MySQL that holds data that may look like this:
>
><b>Rose Painting</b>"Looks really nice, blah, blah"<b>25.00</b>
>
>Now, I want to pull that data back into a form <textarea> to edit.
>Here's how I have unsuccessfully been doing it:
>
>?>
>.... beginning code
><td>Description:</td>
><td><textarea name=\"description\" value='$description' cols=\"50\"
>rows=\"5\"></textarea></td>
>...ending code
>?>
>
>I looks like that the embedded html in the MySQL data is actually
>being "rendered" (for the lack of a better term).
>How can I get the whole chunk of data back into the form?
>
Well, if you're using PHP:
echo
'<td>Description:</td>',
'<td><textarea name="description" cols="50" rows="5">',
htmlentities($description),
'</textarea></td>'
;
Presumably, other web development languages have an equivalent
construct to PHP's htmlentities().
Also, the value of a textarea tag is not put in a 'value' attribute
within the tag as with the INPUT tag; it is put in the textarea
'container' - that is, between the <textarea> and </textarea> tags.
- steve
--
+--- "They've got a cherry pie there, that'll kill ya" ------------------+
| Steve Edberg University of California, Davis |
| [EMAIL PROTECTED] Computer Consultant |
| http://aesric.ucdavis.edu/ http://pgfsun.ucdavis.edu/ |
+-------------------------------------- FBI Special Agent Dale Cooper ---+
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]