Skip to content
This repository has been archived by the owner on Aug 30, 2020. It is now read-only.

Generating Checkbox creates hidden input #2

Open
MagedAhmad opened this issue Aug 7, 2020 · 2 comments
Open

Generating Checkbox creates hidden input #2

MagedAhmad opened this issue Aug 7, 2020 · 2 comments

Comments

@MagedAhmad
Copy link

Not sure if this is meant or not but when creating a checkbox

{{ BsForm::checkbox('something', 'value')->checked(false) }}

this creates a checkbox + hidden input with same name of the checkbox and default value to 0

When submitting the request now i get two values for same request['something'] value + 0

@ahmed-aliraqi
Copy link
Contributor

ahmed-aliraqi commented Aug 10, 2020

@MagedAhmad Thanks for reporting, this issue will fix in next release,

you should add default() method in checkbox component and should be optional:

{{ BsForm::checkbox('something', true')->default(false)->checked(false) }}

@ahmed-aliraqi
Copy link
Contributor

@MagedAhmad you can fix it in master branch and open PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants