Auto Complete form using URL Parameters

QuestionsAuto Complete form using URL Parameters
Mike asked 2 years ago

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

1 Answers
Mike answered 2 years ago

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

Your Answer

19 + 14 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?