-
Notifications
You must be signed in to change notification settings - Fork 41
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
Custom inputs aren't working with native form submissions #341
Comments
Thanks for this, currently Flux doesn't support using it's custom input elements (checkbox, radio, switch, listbox, etc.) in native forms. We intend to explore this ability so I'm going to leave this issue open until then. Thank you for the report. |
Hey guys, This is a big concern. No matter what I tried, the checkbox does not submit the terms accepted. On the browser inspect, it seems working, but somehow, it does not submit the "accepted" value to the db. Thus, it gives the required terms error. I have been working on this for last 3 days. Now, I have to wait till you release an update on this. Till then, I will remove the terms "required" attribute. Thanks. |
Hey @aydinza , here's a quick workaround with AlpineJS that I used to fix this issue in the jetstream-flux package: <flux:field variant="inline" x-data="{ terms: false }">
<input type="checkbox" name="terms" id="terms" x-model="terms" class="hidden" />
<flux:checkbox x-model="terms" />
<flux:label>...</flux:label>
</flux:field> I know it's not the prettiest approach, but if you want your checkbox to stay consistent with Flux in a native form, I think this is the only way to go (at least for now). |
Actually I have tried that. But mine did not work. I been trying to apply the dark mode and guess I changed some jx settings or maybe another script just messed up things. Till there's a fix, I will keep the terms not required and auto seeded as true. Thanks for the respond. |
I'm trying to use a checkbox in a regular form with attributes like
name="model"
instead ofwire:model
:The problem is, the checkbox component isn't passing the
name
attribute down to the final checkbox element. In this example, that means the form submits without the$terms
variable, even if the checkbox is checked.Looking at the component's code, I see there’s a
@props
directive setting a$name
variable with the value ofwire:model
, but I don’t think it’s actually being used anywhere.Thanks a lot!
The text was updated successfully, but these errors were encountered: