Kentico Forms - After the form is submitted

Olivier Cozette asked on November 17, 2014 22:19

I have created a Form, using the Forms Tool. (oups, Version 7) Once the form is completed by the end user and the submit button is pressed, I use the "Redirect to URL:" option, to show other related informations to the user, BUT I also need to show the user the ID (sequential number) of the form he has just submited (as a proof), ID which is already persisted on the Kentico Forms Table (FormId). So, how can I (retrieve and) show the user this information or any other information he/she just have submitted, and is already persisted on the DB on the redirected page ? (I can't just retrieve the last #id from the DB, it is not safe enough to do so) Thanks

Juan

Correct Answer

Joshua Adams answered on November 17, 2014 22:24

You could include the id in the url as a macro parameter:

www.test.com/thanks?id={%id%}

Then have a webpart or alternative form that displays the data using labels to the user.

2 votesVote for this answer Unmark Correct answer

Recent Answers


Virgil Carroll answered on November 18, 2014 06:00

You can also leverage the Forms events and add your code to the OnAfterSave event. You could then get the form ID or whatever other properties you want and pass it to what ever.

Check it out here: Working with form dats using the API

0 votesVote for this answer Mark as a Correct answer

Olivier Cozette answered on November 19, 2014 15:28

Thanks Joshua, but I think my problem still remains: I don't have an ID yet, my form has not been created. I'll give it a try dough.

0 votesVote for this answer Mark as a Correct answer

Olivier Cozette answered on November 19, 2014 19:23

In fact Joshua, you were right, but I had to change your code to:

www.test.com/thanks?id={%id%}

Thanks a lot

Juan

0 votesVote for this answer Mark as a Correct answer

Joshua Adams answered on November 19, 2014 22:37

Glad it worked!

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.