Hello friends, I have created a web form to accept some details of the user. It is a multi-page form. Before submitting the form, I want to show the user the details filled by him. For e.g.

If the component fields are "First Name", "Last Name" and "Age", I want that user be shown something like this:

You entered the following data:
First Name: ABC
Last Name: XYZ
Age: 20
Please make sure that the information entered is correct before submitting the form.

I suppose this can be done using markup component, but i am unable to embed php code in the markup component. Can you please help me with this. Thanks in advance.

Comments

quicksketch’s picture

You actually can embed PHP in the markup component by changing the Input Format to PHP when editing the markup component. I'd probably suggest building the confirmation into the form through theming (see THEMING.txt) or hook_form_alter() so you can keep your code in version control or something less accident prone than coding in a textarea.

rushala’s picture

Thanks for your help.. i didn't know about the php filter module and enabled it from "admin/build/modules/". But can you please elaborate a bit about hook_form_alter()?

quicksketch’s picture

Status: Active » Closed (fixed)

I'd suggest following the feature request at #435232: Summary/review/preview page before final submission in multistep forms for a confirmation page.

Support on writing custom code (such as using hook_form_alter()) is not provided in the Webform issue queue.