CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   MySQL (http://www.codingforums.com/forumdisplay.php?f=7)
-   -   How do I display data from a table in a textarea (http://www.codingforums.com/showthread.php?t=284056)

Eggweezer 12-12-2012 10:24 PM

How do I display data from a table in a textarea
 
I am pulling a variable (which is actually a long string) from a dbase table, and trying to display it in a "textarea" in a form.

It does work, BUT... it does not display it as a textarea as you would expect with 10 rows and 100 columns.

It just displays as only 1 row of about 20 columns. Why does it not display as a "textarea"? All the data is inside there (if you scroll to the right).

Please help me! Thank you.

Here is my line of code:
[icode]
<input type="textarea" cols="100" rows="10" id="paragraph" name="paragraph"value="<?php echo $paragraph; ?>" />
[/code]

PS: I'm sorry, I was not sure how to display the code with the [code] & [icode]

Old Pedant 12-12-2012 10:33 PM

Ummm...because you forgot your basic HTML?

Code:

<textarea cols="100" rows="10" name="paragraph"><?php echo $paragraph; ?></textarea>
Usually no point to giving a <textarea> an id. The name is usually all that is needed.

Eggweezer 12-12-2012 10:38 PM

Duh! I guess am tired tonight.

Thank you very much Old pendant.


All times are GMT +1. The time now is 07:18 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.