Unfortunately, the username and password you have entered do not match!

Registration

Unfortunately, this username is already taken!

Unfortunately, this e-mail address is already used!

Please retype the verification code.

All fields are required

Passing values to another form

Welcome, Guest
Username Password: Remember me

Passing values to another form
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Passing values to another form

Passing values to another form 1 year, 9 months ago #10493

  • deusdies
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
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

I figured it out 1 year, 9 months ago #10496

  • deusdies
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
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.

Re:I figured it out 1 year, 7 months ago #10695

  • lroberts
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
So, where exactly do I paste this code?

Re:I figured it out 6 hours, 1 minute ago #0

Hello,
This is an automatically generated message.
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 wish to receive our 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: http://www.rsjoomla.com/support-policy.html.

Thank You!
PLEASE NOTE: This topic is NOT locked and you can add replies to it. Other users are free to reply as well. This message has been generated by a bot and has no effect on the topic whatsoever.
  • Page:
  • 1
Moderators: alex, alexp, octavian, bogdanc, andreic
Time to create page: 1.04 seconds
Feedback