Forums

jump directly page 7 of my multi-pages form

webcrea 04 Jun, 2015
Hello,

I try to jump directly at the page 7 of my multi-pages form

I create 2 submit button
- One with the Extra params event=page2
- One with the Extra params event=page7

in the Setup a html render form, I tested several manner but always is the page 1 to be reload

event page2 and page7 works well if I call them directly with event=page7 at the end of the url

thanks
GreyHead 04 Jun, 2015
Hi Christophe,

How do you want this button to behave?

+ does it submit the form and then redirect? or
+ does it redirect immediately, like a back button?

Bob
webcrea 04 Jun, 2015
Hello Bob,

submit the page and goto the next page 2 or 7

Best regards
GreyHead 04 Jun, 2015
Hi Christophe,

The entries in the Extra Params aren't submitted so that won't work.

I've done this before using the Submit Button values as say Submit + Go To Page 7

Assuming that both buttons have the name 'submit_btn' then In the form On Submit event there will a value for $form->data['submit_btn'] that you can use to trigger an Event Switcher.

Bob
webcrea 04 Jun, 2015
ok, I can do more simple, I have a text input with 2 values possible
I include a "Custom code" in the first page with 2 if
<?php
$a =  $form->data['online_prg'];
echo $a;
if(strlen($a)){
if($a == "Classroom Learning") {
   header('https://www.frenchwinesociety.org/index.php?option=com_chronoforms5&view=form&Itemid=1618&lang=en&chronoform=Survey-Evaluation&event=page2');
}else{
   header('https://www.frenchwinesociety.org/index.php?option=com_chronoforms5&view=form&Itemid=1618&lang=en&chronoform=Survey-Evaluation&event=page7');
}
}
?>


the echo shows the value but the header doesn't work
webcrea 04 Jun, 2015
sorry I miss Location:
GreyHead 04 Jun, 2015
Hi Christophe,

I don't think that header will work without breaking other things, please try:
<?php
if ( empty($form->data['online_prg']) ) {
  return;
}
echo $form->data['online_prg'];
if ( $form->data['online_prg'] == "Classroom Learning" ) {
  $page = 'page2';
} else {
  $page = 'page7';
}
$app = \JFactory::getApplication();
$app->redirect('https://www.frenchwinesociety.org/index.php?option=com_chronoforms5&Itemid=1618&lang=en&chronoform=Survey-Evaluation&event='.$page);
?>
This topic is locked and no more replies can be posted.