In Add/Edit customize the dropdown value

QuestionsIn Add/Edit customize the dropdown value
varun asked 11 years ago

Hi,
As per shown in your examples in add/edit,i am able to do,get_dropdown_values("select distinct EmployeeID as k,EmployeeName as v from emptable");

where as i need to customize this,i will be getting Value from URL as $variable=$_GET['EmpAge'];

so,i want to display the above query as "Select distinct EmployeeID as k,EmployeeName as v from emptable where EmpAge='$variable'";

i am not able to put the querystring into this set_dropdown_values,why?
can u provide me assistance of using URL variable in dropdown_value query

Thank u.

1 Answers
Abu Ghufran answered 11 years ago

Checkout faq.

##### Q) How to load grid based on $_POST data from other page?

The grid is loaded with 2 server calls.

1) load the columns of grid.
2) do an ajax call, to load data of grid.

Now, if you want to pass data from external form, it is available for step1. But not there in 2nd ajax call, as it is not posted.
Solution is to put the POST variable in session and use it from session for step2.

e.g.

if (!empty($_POST["personid"]))
{
$_SESSION["personid"] = $_POST["personid"];
}
$pid = $_SESSION["personid"];

and use `$pid` in your SQL.

Your Answer

19 + 3 =

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?