duannuo4620 2014-10-28 22:21
浏览 43
已采纳

完全隐藏非管理员的表单输入值,而无需删除表单数据

Having a problem with sensitive data in a client-facing form.

Here's my problem: There is a form where I (as the site admin) can edit certain fields on behalf of a client, but that client shouldn't ever see the data. Here's what I've tried:

  1. Disabled input fields and set the field value as "Set by Administrator". Problem: When client saves the form, these fields are wiped (taking the "disabled" fields as being blank).

  2. Set input fields as "readonly" and type="password". This saved correctly, but these values are still viewable in the html source code itself (for any clients savvy enough to look there).

  3. Removed the input field entirely for non-admins with the text "Set by Administrator". But down the road, the system still tries to save values for these input fields (even if they don't exist), so they still end up coming back blank when I view them as the admin.

Since I'm editing a WordPress plugin, I'd prefer the modifications to be light (in other words, I'd really rather not dig through the code even farther to modify the save content if there is a workable solution here).

Thanks for the help.

  • 写回答

1条回答 默认 最新

  • ds0678 2014-10-30 21:48
    关注

    I just ended up editing the downstream save content. I couldn't find a good solution for this in the form itself.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 前端echarts坐标轴问题
  • ¥15 CMFCPropertyPage
  • ¥15 ad5933的I2C
  • ¥15 请问RTX4060的笔记本电脑可以训练yolov5模型吗?
  • ¥15 数学建模求思路及代码
  • ¥50 silvaco GaN HEMT有栅极场板的击穿电压仿真问题
  • ¥15 谁会P4语言啊,我想请教一下
  • ¥15 这个怎么改成直流激励源给加热电阻提供5a电流呀
  • ¥50 求解vmware的网络模式问题 别拿AI回答
  • ¥24 EFS加密后,在同一台电脑解密出错,证书界面找不到对应指纹的证书,未备份证书,求在原电脑解密的方法,可行即采纳