Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pre-select radio not working #98

Open
wrabit opened this issue Apr 24, 2020 · 1 comment
Open

pre-select radio not working #98

wrabit opened this issue Apr 24, 2020 · 1 comment

Comments

@wrabit
Copy link

wrabit commented Apr 24, 2020

Even though the model value is === 0, it is not pre-selecting the radio when:

{!! Form::open()->fill($model !!}
{!! Form::radio('has_tickets', 'No', 0) !!}

image

<?= $model->has_tickets === 0 ? 'true' : 'false' ?>

Returns 'true';

@wrabit
Copy link
Author

wrabit commented Apr 24, 2020

The issue is caused by type hinting the $value argument as a string in the checkbox and radio methods:

public function radio(string $name = null, string $label = null, string $value = null, bool $checked = null): FormService

Can I ask why? Why not just let the developer pass through their own raw variable. So number can be with or without quotes?

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

No branches or pull requests

1 participant