Can you automatically pass URL Parameters to a popup ADD form?
I am using a URL Link to open a report with a GET() Variable. If the record is not found, I want to click the + sign to add a new record and have the GET() Variables automatically passed to the Add Form.
I was thinking a call-back style function could be used, but I was unable to get it working on pop-up as the GET Variables are not part of the report data-set.
URL Would be formatted with two variables:
http:\\websitehere\report1.php?REF_ID=1235&TYPE=PDC
Thanks for any assistance.
Mike
I answered my own question!!
The answer is yes! This is covered in the demos.
Get he Variable and store it with a session variable, then use the Add Options After Show Form.
Get the Session variable with something like this:
if($_GET[“REF_ID”]) {
$_SESSION[“REF_ID”] = $_GET[“REF_ID”];
$doctype = $_SESSION[“REF_ID”];
}
Then in your Grid Options, add the AfterShow Function:
$grid[“add_options”][“afterShowForm”] = “function(formid){
$(‘#REF_ID’).val(‘$doctype’);
}”;
Thanks
Mike