Do hidden form elements get submitted?

后端 未结 2 1287
太阳男子
太阳男子 2021-02-18 15:13

If jQuery\'s toggle() is used on a

containing form elements, will those form elements get submitted with the form, even though they are hid
相关标签:
2条回答
  • 2021-02-18 15:40

    In order to prevent submitting, you have to disable the elements. Hiding doesn't do the trick (I had the same issue a while ago)

    0 讨论(0)
  • 2021-02-18 15:50

    Yes, they'll get submitted unless they are removed from the document or have the disabled attribute set on them.

    For more information, see the HTML5 Working Draft — Section 4.10.22.4 Constructing the form data set. The information there is more-or-less the same as previous HTML versions.

    0 讨论(0)
提交回复
热议问题