HTML - How to prevent user from editing form's value?

后端 未结 4 1453
梦毁少年i
梦毁少年i 2020-12-03 11:26

I am developing a simple web apps that allowed user to key in information using a form when I discovered I could edit that form\'s input default value using Chrome -> Check

4条回答
  •  没有蜡笔的小新
    2020-12-03 12:15

    For typical users, you can just add the attribute readonly to the form field(s).

    For more advanced users/hackers that try to manipulate your server, you need to validate every piece of data that is submitted to ensure that tampering is caught and rejected. There is no client-side technique for this that is tamper-proof.

提交回复
热议问题