how to put retrieved value from database into textarea

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kang jia
    New Member
    • Jun 2007
    • 88

    how to put retrieved value from database into textarea

    hi

    i retrieved value from database and now would to put these value inside a textarea. however, it seems cant put in, but the value can be retrieved from database. i don;t know where is wrong,

    this the code i put in:

    <td><textarea ='text' COLS='40' ROWS='6' value='<? echo $detail?>'></textarea></td>


    can help me with it. thanks in advance:)
  • ak1dnar
    Recognized Expert Top Contributor
    • Jan 2007
    • 1584

    #2
    Html Forms text areas are differ than normal elements.

    [code=php]<textarea ="text" COLS="40" ROWS="6"><?php echo $detail ?></textarea>[/code]

    Comment

    • kang jia
      New Member
      • Jun 2007
      • 88

      #3
      Originally posted by ajaxrand
      Html Forms text areas are differ than normal elements.

      [code=php]<textarea ="text" COLS="40" ROWS="6"><?php echo $detail ?></textarea>[/code]


      hi
      thanks with it. it can work now, but how can i limit the amount of world in one row and when it hit the amount it will automatically go to next row. is it use wrap?
      now i use the following code
      [code=php]

      <td><textarea ='text' name='detail' COLS='40' ROWS='6' wrap="virtual"> <? echo $detail?></textarea></td>

      [/code]

      i don;t know what is virtual , but it seems can not work , can help with it. thanks :)

      Comment

      • pbmods
        Recognized Expert Expert
        • Apr 2007
        • 5821

        #4
        Heya, Kang.

        Try not to use short tags (i.e., use '<?php' instead of '<?'). Future versions of PHP will *not* support short tags.

        As for your question, check out wordwrap().

        Comment

        Working...