Menu icon Foundation
Form reset for custom form

I am having trouble getting the reset button to clear checkboxes on a Foundation 4 custom form. I haven't found anything specifically talking about this issue so far. I found this post (which is Foundation 5): http://foundation.zurb.com/forum/posts/3317-refresh-form-on-click-of-cancel-button , which is slightly similar to my issue.

I modified the Codepen that Wing-Hou Chan created to help troubleshoot the issue to demonstrate my problem. As you can see, the reset button does not clear the checkbox. If I remove the "custom" class, the reset works. However, the look and functionality of the form relies on the custom class, so that's not an option.

http://codepen.io/jdkoelsch/pen/jzLgB

Is there anything I can do (besides updating to Foundation 5) to get the reset button to work?

Foundation 4forms

I am having trouble getting the reset button to clear checkboxes on a Foundation 4 custom form. I haven't found anything specifically talking about this issue so far. I found this post (which is Foundation 5): http://foundation.zurb.com/forum/posts/3317-refresh-form-on-click-of-cancel-button , which is slightly similar to my issue.

I modified the Codepen that Wing-Hou Chan created to help troubleshoot the issue to demonstrate my problem. As you can see, the reset button does not clear the checkbox. If I remove the "custom" class, the reset works. However, the look and functionality of the form relies on the custom class, so that's not an option.

http://codepen.io/jdkoelsch/pen/jzLgB

Is there anything I can do (besides updating to Foundation 5) to get the reset button to work?

Julian Warren almost 5 years ago

A bit late I know but you have to tell foundation forms something has happened (none of this exists in F5 which is a pity)

Add this at the end:

$('#chkbox').trigger('change');

As far as I can tell you must do this for individual elements.

Custom forms are funky and don't play nicely with cascadingdropdown.js or parsley.js (brilliant form validation). I will be weaning myself off them so have to say goodbye to nice big checkbox ticks.