I have some custom code within a button that redirects to an add page at the end. The add page has pop up turned on. How do I redirect to the add page and open it in a popup? current code in button "client after"
location.href='email_add.php'; tried this but it failed "client after"
Ok. solved with help from Cristian The problem is that you cannot open an add page in pop up except on the page that you are on. So I could not open the email_add.php on the events_list.php in a popup from my button event. My solution was to join the tables and add events_add.php with the details from email_add.php
in the after client button I added // redirect to events page
location.href='events_list.php?add=yes';
Retrieved php $_REQUEST in javascript by adding this in the before list page on list page if ($_REQUEST["add"] == "yes")
{
$add = "<script> window.add = 'yes';</script>";
$xt->assign("custom_xweb4",$add);
}
else
{
$add = "<script> window.add = 'no';</script>";
$xt->assign("custom_xweb4",$add);
}
added the code to redirect to add page in javascript on load on list page if(add == "yes")
$("#addButton"+pageid).click(); Remember you then need to unset the php variables on the before add and add the data to the correct table in before add. Worked for me