dongshun7312 2016-10-07 17:34
浏览 160
已采纳

在textarea中显示数据库值[重复]

This question already has an answer here:

I am trying to display the value of a textarea in a form that will enable someone to edit its value. The textarea displays nothing but I checked the database and there is a 2 sentence value. Here is the code I am using:

<textarea rows="5" cols="55" name="P1Bio" value="<?=$record['P1Bio']?>">
</textarea>

P1Bio is the field. On the same form, I am also getting values from textboxes and it is working fine. Here is the code that I am using for text boxes:

<input type="text" size="90" name="P1Email" value="
<?=$record['P1Email']?>">

Can someone please tell me why the textarea is not showing anything? Thank you.

</div>
  • 写回答

4条回答 默认 最新

  • duanbichou4942 2016-10-07 17:35
    关注

    There is no value attribute with textareas.

    You need to put the content in between the open and closing tags like this:

    <textarea rows="5" cols="55" name="P1Bio"><?=$record['P1Bio']?></textarea>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元