SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast icky_thump's Avatar
    Join Date
    Nov 2007
    Location
    St. Louis, MO, USA
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    textarea store and return

    Hi all,

    I have a form on my site for user registration.
    When that is filled in and returned, there is a copy of it in the Admin panel of the CMS (custom built).
    I'm wanting to add a field for NOTES, only on the admin side.

    I've added it in and
    if I use the INPUT tag, I can type in, it gets stored in the database and if I save and leave that admin page, when I come back, the NOTES are there.
    That is what I want.

    But, I want a bigger box, more space so as to more readily see what is typed into the notes.
    So, I'm switching from INPUT to TEXTAREA.
    When I use TEXTAREA, I type it in, it's stored in the database, but when I save and leave the page, then come back, the notes are empty, it does not pull those notes back in from the database.

    I can't figure out what I'm missing.
    Any suggestions???
    Thanks!!!!
    Pandora can't go back into the box - he only comes out.

  2. #2
    SitePoint Enthusiast icky_thump's Avatar
    Join Date
    Nov 2007
    Location
    St. Louis, MO, USA
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    finally figured it out.

    using INPUT, the php call to the database is in the value="" part, and the tag is self closing.
    using TEXTAREA, it needs to put in between the opening and closing TEXTAREA tags to bring in back in from the database.
    Pandora can't go back into the box - he only comes out.

  3. #3
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,233
    Mentioned
    47 Post(s)
    Tagged
    1 Thread(s)
    Sounds like PHP doesn't know how to interface with textareas... Javascript knows for example that the .value property will contain the value text, like with inputs.

    Though I've also seen php code using get/post where the "name" attribute of the textarea worked fine.

    <textarea name="foo" id="bar" rows="" cols="">MAH TEXT YO</textarea>
    ...

    $thetext = $get/post['foo']

    $thetext is now MAH TEXT YO


Bookmarks

Posting Permissions

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