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
Form emptied on submit, resulting in invalid form #106
Comments
@guillaumepotier I now found out that data is not even submitted at all. Any idea why |
FYI: I can now confirm that cherry-picking #105 on top of tag We will start using this one in production: https://github.com/rvanlaak/Garlic.js/tree/pre-events So there is some regression in the standard behavior since |
Hi @rvanlaak I do not understand the problem here. I do not recall Garlic emptying values ever on a form. It just fills values with what it has in storage. Clearing/Emptying fields is really weird. Could you provide a jsbin/jsfidle etc.. to show that behavior with latest release please? Thanks |
I'm having the same issue. It also happens with |
Ran into the same bug, had to revert to |
Facing the same issue. It's wierd. The textboxes contains the value, but the empty data got sent. |
@guillaumepotier, it's on this line, https://github.com/guillaumepotier/Garlic.js/blob/master/garlic.js#L118. Is it a typo or what? With this line of code, it will empty all inputs on submit.... |
@guillaumepotier what about merging #105 to resolve this? 👍 |
So, it looks to me like #105 has been merged in, which from the comments above, suggest it may resolve this issue. It doesn't. The issue still exists for me. Even if I remove all my garlicjs configuration options, and just call I've just tested going back to the prior 3 commits (I haven't gone back further) and this problem still exists. So add this point I don't think it's an introduced error, maybe it's a change in browser behavior? |
I've got it working. I agree with @chamnap that the error is on this line https://github.com/guillaumepotier/Garlic.js/blob/master/garlic.js#L118 I changed it from |
Ok guys, seems to be a nasty typo here. Would you please submit a fix PR then? Best |
Please see #116 |
@guillaumepotier while testing #105 on
staging
, another form we use Garlic on gets emptied / destroyed before submit. As a result of that no data is sent, and the form validation does not pass as the CQRF token also is cleared.Narrowed this down to comparing 1.2.4 to 1.3.0, on which the bug occurs (so is not specific to PR #105 ): 1.2.4...master
The form initialization used to be like this:
and restoring the form to a working situation was possible by:
We now see that the form is emptied, but that the form submit works. I think the form should not be emptied, but only the storage should be emptied right?
The text was updated successfully, but these errors were encountered: