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 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号