• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Passing values to another form

Passing values to another form 13 years 11 months ago #10493

  • deusdies
  • deusdies's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 1
So I have two forms: form1 and form2. Form1 shows on the front page and has two fields: name and email. Form2 is buried within the pages and has 10 fields, but also includes name and email.

Now I don't want my clients to have to enter their name and email twice; so, is there a way to pass the value from form1 into form2?

I've set up the form2 page URL as the thank-you URL, so now that displays as the form's action URL (in the source code).

I've read the FAQ where it says how to pass a variable through URL and how to catch it; that method works, however, I can't have my clients manually input the values into the address bar (duh).

So, basically, the question is: how to pass variables from one form to another?

Thanks,
Bogdan
The administrator has disabled public write access.

I figured it out 13 years 11 months ago #10496

  • deusdies
  • deusdies's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 1
I figured it out

I added this code to be executed AFTER the form process (for form1):
if (isset($_POST['form']['Name']))
{
$name = $_POST['form']['Name'];
header('Location: <your default action URL for the form, see the web page source code>&myname='.$name);
exit();
}

And this is the default value for the relevant textfield in the form2
//<code>
$myname_value = $_GET['myname'];
return $myname_value;
//</code>

Works like a charm.
The administrator has disabled public write access.
The following user(s) said Thank You: alexis.marks

Re:I figured it out 13 years 10 months ago #10695

  • lroberts
  • lroberts's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
So, where exactly do I paste this code?
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!