If I do that I lose the validation features of cForms.
Correct. That's why it's not considered a feature or 'recommended' solution, merely a workaround if you indeed require multi page forms.
I usually suggest to use jQuery (javascript) to control a larger form on the same page, which requires good Javascript skills.
Is there a way to store one field value and pass it along to a redirected page without activating Alternative Action? I want to keep the validation features of cForms.
no. since the redirect happens after the submission, all $_POST / $_GET would be lost.
What could possibly be done, is to use a PHP session to store all data until the user also submits the last form, here is a possible outline of a solution:
- use my-functions.php to store all submitted form data in the PHP SESSION
- after success submission, redirect to next form page (triggering #1 again)
- the last form is a dynamic form:
- helps you to access the PHP Session using your own PHP
- and building the necessary form field array
- -> you need to create a hidden field for all PHP Session stored data and feed it what's been recorded
- then add your final, visible form fields to the array and have the user submit that last form with all other (hidden) values
possible issue I can think off:
- every form will generate an email, so you may need to use a black hole email address or use this email/info as an adication as to where users may have dropped out the process.
- you need to manage the PHP session and invalidate/reset it if required