This topic is locked

Filtering Auto-Suggest Search Box on List Page

11/23/2007 11:12:43 AM
PHPRunner General questions
K
kenmag author

Is a way to limit the auto suggested options that appear in the search box on the list page as you are entering data to match the SQL query used to produce the list page.
Here is my problem.
I use the List Page "Before SQL Query" event to modify the WHERE clause of the SQL query. This allows me to only display certain values on the list page based on some session variables. This works as expected and works fine.
However, if a user then uses the Search option on the list page, when they start typing in data, the data displayed (as they are typing) is data from the ENTIRE table and NOT limited to the SQL query that produced the list page.
EXAMPLE:

  1. When the user logs in, I set a session variable called $_SESSION["UserLoggedIn"] equal to the logged in user name.
  2. Then when they go to a list page, in the "Before SQL Query" I modify the where clause like: $strWhereClause = "User = '".$_SESSION["UserLoggedIn"]."'";
    This will then show them ONLY their rows. This works great. NOW, when they go to use "Search" on the list page, the data that displays as they are entering their search criteria is for ALL users and NOT just for the rows being displayed on the List page. This is very confusing to the user.
    Is there any way to make the Search box use the modified SQL query?
    Thanks