kevinchappell / formBuilder

A jQuery plugin for drag and drop form creation
https://formbuilder.online
MIT License
2.63k stars 1.4k forks source link

userData is undefined for checkbox-group if no options selected, should be empty array #1477

Closed vijay-torani closed 1 year ago

vijay-torani commented 1 year ago

Description:

check box group is not working when i unchecked and get userdata it still show checked in userdata.

Environment Details:

Expected Behavior

Should Be Unchecked if i Unchecked the checkbox

Actual Behavior

it remain unchecked if i unchecked

Steps to Reproduce

Screenshot - (optional)

Screenshot 2023-10-31 113931 Screenshot 2023-10-31 114017 Screenshot 2023-10-31 114038

lucasnetau commented 1 year ago

The issue here is that there is no userData being returned, if you try to reload the form then it will use the default selected options rather than unsetting them

lucasnetau commented 1 year ago

$('select, input, textarea', container).serializeArray() will remove the input[type=checkbox] if none selected

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 3.16.11 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

vijay-torani commented 1 year ago

The issue here is that there is no userData being returned, if you try to reload the form then it will use the default selected options rather than unsetting them

but i am console the data in console data you Cleary see i am getting checkbox checked but i unchecked the checkbox

lucasnetau commented 1 year ago

No. Your console output had no userData key for the checklist. The 'selected' value you are seeing is the option values set by formBuilder, they are not changed by formRender

vijay-torani commented 1 year ago

that's the point why i am not getting user data for checkbox in all other field i am getting userdata

lucasnetau commented 1 year ago

Please read above. It was a bug which was fixed in a release today. Please retest

vijay-torani commented 1 year ago

ok thank you sir