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

后端 未结 4 1451
梦毁少年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:13

    You can't prevent users from modifying, adding or removing elements in the DOM. If you want that kind of control you should store the values of the elements you are outputting in an object and then compare what's coming in with the form post.

    There are a million ways of doing this, if you want to ill post an example

提交回复
热议问题