What's the point of having hidden input in HTML? What are common uses for this?

后端 未结 12 1158
无人共我
无人共我 2020-12-01 14:51

I don\'t see the benefit of having hidden input? If you set the value of the hidden input why not just use that value at the point where you reference this hidden input?

12条回答
  •  被撕碎了的回忆
    2020-12-01 15:04

    It sends additional information that the user doesn't know or isn't interested in (such as a security token) so that if the form is submitted twice, you can compare the tokens and reject/accept that submission.

提交回复
热议问题