Page 1 of 1

Redirect trigger

Posted: 2012-10-02 21:05
by HelgeLind
Hi

There is something I like to do if is possible?

//start Trigger_Redirect trigger
//remove this line if you want to edit the code by hand
function Trigger_Redirect(&$tNG) {
$redObj = new tNG_Redirect($tNG);
$redObj->setURL("/this_page.php");
$redObj->setKeepURLParams(true);
return $redObj->Execute();
}
//end Trigger_Redirect trigger

later on......
$upd_pv_order_marknad->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Update1");
$upd_pv_order_marknad->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
$upd_pv_order_marknad->registerTrigger("END", "Trigger_Default_Redirect", 99, "/pv/akt_tmp.php?akt_id={GET.akt_id}&order=1");
$upd_pv_order_marknad->registerTrigger("AFTER", "Trigger_LinkTransactions", 98);
$upd_pv_order_marknad->registerTrigger("ERROR", "Trigger_LinkTransactions", 98);
$upd_pv_order_marknad->registerTrigger("AFTER", "Trigger_Default_ManyToMany", 50);
$upd_pv_order_marknad->registerTrigger("AFTER", "Trigger_Default_ManyToMany3", 50);
$upd_pv_order_marknad->registerConditionalTrigger("{POST.KT_Update2} == \"\"", "END", "Trigger_Redirect", 90);

<form........
<input type="submit" name="KT_Update1" id="KT_Update1" value="Save and go to this page" /> <input type="submit" name="KT_Update1" id="KT_Update2" value="save and go to another page" />

Thanks for any suggestions :)

Re: Redirect trigger

Posted: 2012-10-02 21:10
by HelgeLind
forgot to say that its working, but both buttons is redirected / trigged

Re: Redirect trigger

Posted: 2012-10-05 13:47
by Fred
Just had a look at the "normal" buttons on a nextensio form.

The name="KT_Insert" is used as the variable and not the id="KT_Insert".
In fact there is no ID assigned to the buttons.

So try and change the button to the following

Code: Select all

<input type="submit" name="KT_Update1" id="KT_Update1" value="Save and go to this page" /> <input type="submit" name="KT_Update2" id="KT_Update2" value="save and go to another page" />