2014-11-12 06:40
浏览 28


In the following code, I can display the values from the DB in text boxes but how would I display them in the textarea?

<form action="" method="post">
  <input type="hidden" name="id" value="<?php echo $id; ?>"/>
     <?php echo $id; ?>
     <strong>userid: </strong>    
     <input type="text" name="userid" value="<?php echo $userid; ?>" /><br/>
     <strong>name: </strong>     
     <input type="text" name="name" value="<?php echo $name; ?>" /><br/>
     <strong>phoneno: </strong>      
     <input type="text" name="phoneno" value="<?php echo $phoneno; ?>" /><br/>
     <strong>emailid: </strong> 
     <input type="text" name="emailid" value="<?php echo $emailid; ?>" /><br/>
     <strong>description: </strong>    
     <textarea name="description" value="<?php echo $description; ?>" rows="5" cols="40">    </textarea>
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

4条回答 默认 最新

  • dongmu1951 2014-11-12 06:42

    Just put it in the tags like this:

    <textarea name="description" rows="5" cols="40"><?= $description; ?></textarea>
    打赏 评论
  • douqin7086 2014-11-12 06:42

    It is not the value in text area use this

    <textarea name="description" rows="5" cols="40"><?php echo $description; ?></textarea>
    打赏 评论
  • donte1234567 2014-11-12 06:42

    Change this

    <textarea name="description" value="<?php echo $description; ?>" rows="5" cols="40"></textarea>


    <textarea name="description"  rows="5" cols="40"><?php echo $description; ?></textarea>
    打赏 评论
  • douji1999 2014-11-12 06:45
    <textarea name="description"><?php echo $description; ?></textarea>
    打赏 评论

相关推荐 更多相似问题