-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Prevent variable change on form submit #393
Comments
I’m not sure I’m following. Can you show me an example of what you mean? |
You can use a hidden input field or {{ hiddenInput('addressToEditId', addressToEditId) }} OR <form sprig s-val:address-to-edit-id="{{ addressToEditId }}"> |
Thanks Ben! I am also using the same form to create new addresses, where the address id is null. |
It should be possible to maintain state, I can’t see why it wouldn’t be. |
@bencroker
like there https://putyourlightson.com/sprig/cookbook#contact-form I was wondering how to handle "fields[firstname]" for special addresses' fields, but it should be doable with hiddenInput, like
|
Support Request
Hi @bencroker,
I am building an addresses book for a craft commerce website.
I am using the same form include with as variable, the id of the address to edit.
My issue is that after submitting the form, the variable is reset.
How could I prevent that? I have tried with the hidden input field, but the result is not that nice.
Plugin Version
3.5.0
The text was updated successfully, but these errors were encountered: