Hi,
I am creating a form, where people can spend money for wishlist items. (For a wishlist of a wedding page). Every Item has a total amount, a current amount and a remaining amount being stored as TVs.
In the form to submit to give money, there is a field for the amount, the person wants to give. Next to that field, the remaining amount of this wishlist item is being displayed. (taken from the TV of that resource)
See Attachment for Printscreen of the form
When the user submits the form, the remaining Amount should be updated by adding the amount of the user to the current amount of that wishlist item. I got that all up and working by storing the values as template variables of the wishlist item page and using a custom hook to update the tv values accordingly.
My only problem is, now when the user submits the form and the page reloads, the remaining amount next to the amount field is still the same as before. Only after making a regular page reload, the remaining amount gets updated.
I tried several things to make it work:
- Calling everything uncached
- Using a uncached Snippet directly in the form template, which reads the remaining amount directly from the resource's template variable
- using FormItRetriever and my custom Hook to set the new remaining value directly in the hook
Nothing seems to work. It seems like, that the form fields are not parsed again on form submit, but just displayed again
A workaround would be to just hide the form fields on submit and only show the thank you message, but I also cannot find any input, if that's possible
Any Idea?
Best
Jan