• 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: Sending variables to consecutive forms in J1.5.x

Sending variables to consecutive forms in J1.5.x 15 years 3 months ago #6298

Hi

I've been struggling to get this working. I've followed the advice and solutions in the forum but they don't seem to work in J1.5.x

The method that seems most suited to my needs is to send the variables using the following method (from http://www.rsjoomla.com/index.php/RSform-How-To/1412-Sending-variables-to-consecutive-forms.html):

Form1, on process:
if(isset($_POST['form']['email'])){
    $_SESSION['form2']['email']['default_value'] = $_POST['form']['email'];
}

Form2, on display:
if(isset($_SESSION['form2'])){
    foreach($fields as $i=>$field){
        if($field->name=='email') $fields[$i]->default_value = $_SESSION['form2']['email']['default_value'];
    }
}

This doesn't seem to work though. Nothing is recorded in the database when following the steps outlined in the link above.

Another method would be to send the variables via the url as suggested in this post http://www.rsjoomla.com/index.php/RSform-How-To/3402-RePassing-a-value-into-a-form.html#3402. However, I can't see how to put the variables there in the first place!

Has anyone got the first solution working in J1.5.x? Can anyone give me some pointers for either method? In fact, any help at all would be appreciated!
The administrator has disabled public write access.

Re:Sending variables to consecutive forms in J1.5. 15 years 3 months ago #6349

Right. I'm nearly there but I need some help.

For the first form: -

Script called on form process:
session_start();
$form = $_POST['form'];
$_SESSION['form2'] = $form;

For the second form: -

Script called on form display:
session_start();
$form2=$_SESSION['form2'];

I can now use the variables from the first form using the format:

$form2;

BUT I can't seem to set a default value for any of the parts of the second form

Can anyone help?


Incidentally, because I'm using this for unregistered users I wanted to make sure that I'd cleared the session after using it so I put this into the script called on form process for form2: -
session_start();
session_destroy();
Last Edit: 15 years 2 months ago by mattfaulds. Reason: markup wrong
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!