doushai4890 2018-04-24 07:34
浏览 84

如何在提交时只读取输入字段并将表单数据保存在字段中?

Can you all help me with the approach I need to take once the user has submitted his data, I want those certain fields to be read-only permanently for that user upon submit.

So far I am able to save the data to MYSQL DB on submit and the below code also keeps the data in the field. But on refresh, the data in the form field disappears. How do I solve this? Any help and suggestions are greatly appreciated. Thank you.

<label class="control-label col-sm-2" for="lname">Last Name*</label> <input type="text" class="form-control" id="lastname" placeholder="Last Name" name="lastname" value="<?php if(isset($_POST['lastname'])) {echo htmlentities($_POST['lastname']);}?>" autocomplete="nope" required/>

enter image description here it should look like this each time the user login.

  • 写回答

3条回答 默认 最新

  • doujiu8826 2018-04-24 07:38
    关注

    Its very simple just add readonly into your input filed.

    <input type='text' value='Test' id='test1' readonly>

    评论

报告相同问题?

悬赏问题

  • ¥15 Odoo17操作下面代码的模块时出现没有'读取'来访问
  • ¥50 .net core 并发调用接口问题
  • ¥15 网上各种方法试过了,pip还是无法使用
  • ¥15 用verilog实现tanh函数和softplus函数
  • ¥15 Hadoop集群部署启动Hadoop时碰到问题
  • ¥15 求京东批量付款能替代天诚
  • ¥15 slaris 系统断电后,重新开机后一直自动重启
  • ¥15 QTableWidget重绘程序崩溃
  • ¥15 谁能帮我看看这拒稿理由啥意思啊阿啊
  • ¥15 关于vue2中methods使用call修改this指向的问题