Unable to display data using PHP to populate a text area field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jej1216
    New Member
    • Aug 2006
    • 40

    Unable to display data using PHP to populate a text area field

    Using PHP to populate a form, I am not able to display any text area data -- it displays as blank.

    [code=php]
    <?php echo "<textarea rows=11 cols=120 name=inc_descr value='".$incde scr."'></textarea>"; ?>
    [/code]

    The value might be "Patient stumbled on his shoelaces and fell to the floor. Staff were unable to get to the patient to break his fall."

    Using the code above, the text area is blank.

    Thanks,

    jej1216
  • Purple
    Recognized Expert Contributor
    • May 2007
    • 404

    #2
    Hi,

    try

    [PHP]echo "<textarea rows='11' cols='120' name='inc_descr '>".$incdescr." </textarea>";[/PHP]

    the text to be output goes between the textarea tags..

    [PHP]echo "<form method = 'post'><textare a rows='11' cols='120' name='inc_descr '>".$incdescr." </textarea>";
    echo "<input type='submit' name='submit' value='go'>";
    print("<br>'$ _POST' Array follows ==></br></form>");
    print_r($_POST) ;[/PHP]

    will illustrate what happens if the user changes the default text in the text area..

    Purple

    Comment

    • jej1216
      New Member
      • Aug 2006
      • 40

      #3
      Originally posted by Purple
      Hi,

      try

      [PHP]echo "<textarea rows='11' cols='120' name='inc_descr '>".$incdescr." </textarea>";[/PHP]

      the text to be output goes between the textarea tags..

      [PHP]echo "<form method = 'post'><textare a rows='11' cols='120' name='inc_descr '>".$incdescr." </textarea>";
      echo "<input type='submit' name='submit' value='go'>";
      print("<br>'$ _POST' Array follows ==></br></form>");
      print_r($_POST) ;[/PHP]

      will illustrate what happens if the user changes the default text in the text area..

      Purple
      Thanks - that fixed it.

      I am slowly but surely learning the tricks for these forms!

      Thanks again,

      jej1216

      Comment

      Working...