Skip to content

Read data from submitted forms and display it to the user that submitted the form #334

Discussion options

You must be logged in to vote

The sulu form bundle makes a redirect after the form is submitted. This is done to avoid duplicated form submits if a user does a page refresh. That make all data which is submitted to be lost on the target ?send=true.

Still it is possible that you listen the the FormSavePostEvent. Then write this data into the session of the user or even better into the flashbag of the session: https://symfony.com/doc/current/components/http_foundation/sessions.html

You create a new controller which read that data from the current user session / flashbag and return it as a JSON. If you are on the ?send=true page your JS need to request that new endpoint you created it and show so the submitted data.

By r…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@PanickingLynx
Comment options

@alexander-schranz
Comment options

@PanickingLynx
Comment options

@alexander-schranz
Comment options

Answer selected by PanickingLynx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants