[removed] True form reset for hidden fields

前端 未结 10 1634
臣服心动
臣服心动 2020-12-14 17:12

Unfortunately form.reset() function doesn\'t reset hidden inputs of the form. Checked in FF3 and Chromium.

Does any one have an idea how to do the reset for hidden f

10条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-14 17:26

    How I would do it is put an event listener on the change event of the hidden field. In that listener function you could save the initial value to the DOM element storage (mootools, jquery) and then listen to the reset event of the form to restore the initial values stored in the hidden form field storage.

提交回复
热议问题