Skip to content

[4.x] Filter out any nulls from front end form checkboxes - #9212

Merged
duncanmcclean merged 6 commits into
statamic:4.xfrom
ryanmitchell:fix/issue-9194
Dec 15, 2023
Merged

duncanmcclean merged 6 commits into
statamic:4.xfrom
ryanmitchell:fix/issue-9194

Conversation

@ryanmitchell

Copy link
Copy Markdown
Contributor

Filter out any null values in checkboxes on front end form requests.

The hidden input cant be removed as it was added to solve an issue on user profile forms.

Closes #9194

@duncanmcclean duncanmcclean left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this is now filtering out null values, it's also filtering out checked values which we don't want to be filtering out.

@ryanmitchell

Copy link
Copy Markdown
Contributor Author

What do you mean by a checked value?

@duncanmcclean

Copy link
Copy Markdown
Member

What do you mean by a checked value?

If I 'check' a checkbox, that doesn't get saved.

@ryanmitchell

Copy link
Copy Markdown
Contributor Author

Yeah but what is the value on the checkbox input? It would need to have a value=“something” for it not to be filtered.

@duncanmcclean

duncanmcclean commented Dec 15, 2023

Copy link
Copy Markdown
Member

Nevermind, I didn't add any options to the checkbox field. My bad! 🤦‍♂️

@duncanmcclean
duncanmcclean merged commit 673ad42 into statamic:4.x Dec 15, 2023
@ryanmitchell
ryanmitchell deleted the fix/issue-9194 branch December 15, 2023 13:35
jesseleite added a commit that referenced this pull request Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Checkboxes fieldtype in a form adds additional null value

2 participants