close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Multi-Step form set-up

Thread began 3/21/2022 7:28 am by s.joiner74419001 | Last modified 3/23/2022 10:40 am by Ray Borduin | 130 views | 4 replies |

s.joiner74419001

Multi-Step form set-up

I have an Application Form which I have split into 4 sections so I can display the process in 4 steps. I have put each section in its own form, all on the same page. So the way I want this to work is each time the user submits a section they are advanced to the next step. I have been trying to set this up using session variables. When the page loads. the value for a session variable named 'formStep'is set to 1. Step 1 of the form has a 'show region utility' round it which shows if the session formStep is equal to 1. I thought that each time the user clicks the next ( submit ) button I could trigger a session variable and set it to 2. and show Step 2 which has the 'show region utility for the same value. But the when the submit button is clicked it doesn't appear to update the session value.

Am I trying to achieve my multi-step form correctly?

Hope this makes sense.
Thanks in advance.

Sign in to reply to this post

Ray BorduinWebAssist

That sounds like a possible solution. If you attach a copy of the page you are working on, I might be able to spot the flaw in your logic.

Sign in to reply to this post
Did this help? Tips are appreciated...

s.joiner74419001

So I have the session vraiable triggered before page load with the value of '1'. I have the first form in a show behaviour:

html:
<?php
if ("".$_SESSION['formStep'] ."" == "1") { // WebAssist Show If
?>
....Form Markup
<?php
} // ("".$_SESSION['formStep'] ."" == "1")
?>



This works fine. So I then re-set the session when the form submits:

html:
<?php
@session_start();
if(isset($_POST["submit_pcd"]) || isset($_POST["submit_pcd_x"])) {
$_SESSION["formStep"] = "2";
}
?>



But this doesn't seem to work. Is this wrong?
page attached!

Attached Files
rtm-application-form.php
Sign in to reply to this post

Ray BorduinWebAssist

After your insert, the page redirects back to itself... that causes the session variable to be reset. I think it will work if you change the trigger on the initial session variable set code from:

php:
<?php

@session_start();
if(
"" === "")     {
  
$_SESSION["formStep"] = "1";
}
?>


to:

php:
<?php

@session_start();
if(!isset(
$_SESSION["formStep"]))     {
  
$_SESSION["formStep"] = "1";
}
?>
Sign in to reply to this post
Did this help? Tips are appreciated...

s.joiner74419001

That works .. thanks Ray

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...