keeping textarea content after a form submission

允我心安 提交于 2019-12-06 11:24:30

You must add code as below,

<textarea  class="textarea" id="textarea1" name="textarea1" type="text">
  <?php if(isset($_POST['textarea1'])) { 
         echo htmlentities ($_POST['textarea1']); }?>
</textarea>

Textarea does not have value attribute.

So add PHP code between opening and closing textarea tag.

try this

        <textarea  class="textarea" id="textarea1" name="textarea1" type="text">
        <?php if(isset($_POST['textarea1'])) {  echo htmlentities ($_POST['textarea1']); }?>
    </textarea>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!