Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    May 2012
    Posts
    153
    Thanks
    115
    Thanked 0 Times in 0 Posts

    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]
    Last edited by Eggweezer; 12-12-2012 at 11:27 PM.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,084
    Thanks
    80
    Thanked 4,552 Times in 4,516 Posts
    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.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • Users who have thanked Old Pedant for this post:

    Eggweezer (12-12-2012)

  • #3
    Regular Coder
    Join Date
    May 2012
    Posts
    153
    Thanks
    115
    Thanked 0 Times in 0 Posts
    Duh! I guess am tired tonight.

    Thank you very much Old pendant.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •