• 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: 2 page form - passing data from 1 to the other.

2 page form - passing data from 1 to the other. 14 years 7 months ago #8701

can i create a 2 page form?

1 that collects and email address with a submit button.
2 the second that populates the email field from what was submitted in the first, then allows the user to complete the form and submit.

help?

Peter
The administrator has disabled public write access.

Re:2 page form - passing data from 1 to the other. 14 years 5 months ago #9177

Did you find an answer to this yet? I am awaiting this as well.
The administrator has disabled public write access.

Re:2 page form - passing data from 1 to the other. 14 years 5 months ago #9181

peter.gariepy wrote:
can i create a 2 page form?

1 that collects and email address with a submit button.
2 the second that populates the email field from what was submitted in the first, then allows the user to complete the form and submit.

help?

Peter


I have a system that will probably do what you need. I use it for conference delegates who wish to submit a paper for discussion. I made 2 linked forms.

Form 1 collects the delegates surname and email address and checks that the delegate has registered for the conference. If the registration exists, form 1 calls form 2 which is a form for entering the paper details and uploading a file with the paper.

Here is what you do:

Make 2 forms called, say, "form1" and "form2" with whatever fields you need including a field for the user email in both. For the example below I have used the name "formemail" in both forms.

In the "Manage Forms" page of the RSForm Pro Component, identify your "form2" and click "preview" in that line of the forms table (NOT the preview in the top menu line of the page). This will open a new window displaying your empty "form2".

Now look at the page address at the top of your browser, it should be something like this:

www.yoursite.com/index.php?option=com_rs...ormId=2&Itemid=99999

note: the missing part of the URL is "form&formi". I cannot stop the editor translating the URL. Just copy the full address, including the http:// part from your browser page address.

(note: if you already have other forms, the address with have a different "formID" number from the "2" shown here.)

Copy this address to your clipboard.

Now close that window and in the "Manage Forms" page of the RSForm Pro component open your "form1".

Then click the "Edit Form" button and paste the address of your "form2" into the area labeled "Return URL".

Move your cursor to the end of the address and add: "&formemail={formemail:value}" without the quotes, so the full entry will be like:

www.yoursite.com/index.php?option=com_rs...ail={formemail:value}

note: the missing part of the URL is "form&formid=2&itemid"

Do not enable the "Thank you" message - leave it empty.

Save your changes to "form1".

Now open your "form2" and click the "Edit" symbol for the "formemail" field. Scroll down to the "Default value" box and enter this :

//<code>
if (isset($_GET)) without the backslashes - the editor again!
{
$formemail = $_GET;
return $formemail;
}
//</code>

Save the changes.

Test your system by opening "form1" in your browser, complete the form and submit. This should immediately open your "form2" with the email address already completed.

You can pass any number of parameters this way - just add "&fieldname={fieldname:value}" to the end of the "Return URL".

I also use this system to pass between forms, new variables calculated from data entered in "form1" (or retrieved from a database) and saved in session variables. In those cases I enter the following code in the "Default value" box of a "form2" element:

//<code>
$fieldname2 = $_SESSION;
return $fieldname2;
//</code>
The administrator has disabled public write access.
The following user(s) said Thank You: david.jones, miles.reid

Re:2 page form - passing data from 1 to the other. 14 years 5 months ago #9182

In my reply above the 2 URLs are hard to read. To clarify them, the parts after site address are:

/index.php?option=com_rsform&formId=2&Itemid=99999

for the first one and

/index.php?option=com_rsform&formId=2&Itemid=99999&formemail={formemail:value}

for the second.
The administrator has disabled public write access.

Re:2 page form - passing data from 1 to the other. 14 years 5 months ago #9186

Parse error: syntax error, unexpected '<' in C:\websites\mysite\components\com_rsform\controller\functions.php(31) : eval()'d code on line 1
The administrator has disabled public write access.

Re:2 page form - passing data from 1 to the other. 14 years 5 months ago #9190

fleadog99 wrote:
Parse error: syntax error, unexpected '<' in C:\websites\mysite\components\com_rsform\controller\functions.php(31) : eval()'d code on line 1

To be able to help you with this we would need to see your code and know where you placed it.

Did you have the 2 slashes in front of the <code> tags, like this?

//<code>
.
.
.
//</code>

They are essential.
The administrator has disabled public write access.

Re:2 page form - passing data from 1 to the other. 14 years 4 months ago #9280

  • tkaboris
  • tkaboris's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 7
Now open your "form2" and click the "Edit" symbol for the "formemail" field. Scroll down to the "Default value" box and enter this :

//<code>
if (isset($_GET)) without the backslashes - the editor again!
{
$formemail = $_GET;
return $formemail;
}
//</code>

Save the changes.


Where is the formemail field?thank you
The administrator has disabled public write access.

Re:2 page form - passing data from 1 to the other. 14 years 4 months ago #9290

tkaboris wrote:
Now open your "form2" and click the "Edit" symbol for the "formemail" field. Scroll down to the "Default value" box and enter this :

//<code>
if (isset($_GET))
$formemail = $_GET;
return $formemail;
}
//</code>

Save the changes.


Where is the formemail field?thank you


formemail is in both forms, it is a textbox field in form1 and a hidden field in form2.

The user enters an email address in form1. Its value is passed to form2 in the Return URL that you set in the Edit Form section of form1. The following needs to be added to the end of this URL:

&formemail={formemail:value}

In form2, the code in the Default Value of the hidden formemail field loads the email address passed from form1 and this is saved together with the data entered by the user in form2.
The administrator has disabled public write access.

Re:2 page form - passing data from 1 to the other. 13 years 9 months ago #11116

  • komita
  • komita's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 40
  • Thank you received: 1
This worked great for me. Now, I'd like to take it another step and it's not working. What I have ...

form1 is the parents information. they click the 'add a child' submit button to take you to form2.

form2 is the childrens information. they enter child1's info. at the bottom i want 2 buttons: 1 for 'add another child' that would return them to form2 to add another child; the other saying 'done adding children submit form' that just exits them from the form.

this is where i'm stuck. i don't think i can use the redirect url because then no matter what button they hit, they'd get redirected.

any help is appreciated. Thanks! Lauri
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!