Search code examples
javascriptformsreset

JavaScript: True form reset for hidden fields


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 fields as well?


Solution

  • Seems the easiest way of doing that is having <input style="display: none" type="text"/> field instead of <input type="hidden"/> field. At this case default reset process regularly.