How do you sense a change in a search form?
I have my posted columns that can be searched on.
I have 6 input boxes to search on, one is a required field.
I only display 100 records at a time so a session var holds the number of records for the current sql search. I don't have user sessions just that session var for the total number of records in the sql.
And this code finds the current page.
if( $page=='' ){
$nRecs=nrows($sql);
echo $nRecs ." number of Recs";
$_SESSION['recs']=$nRecs;
$page =1;
$startPage=100;
}else{
$startPage=$page *100;
}
$sqlLimit="LIMIT $startPage,100 ";
$sql.= $sqlOrder." ". $sqlLimit ;
I have this $page var at the beginning of my function to see whether the page was requrested by the user or not.
$page=$_GET['page'];
How do I sense a change in the search box from the user? Say the user ends on page 12 from search 1 . If I submit a new search and decide I'm done editing page 12 in the first search. What currently happens is I have to delete the page=12 name/value pair in the get url.
Even then then it doesn't pull the new query properly. It is still stuck on the old query. How do I sense the search box values changed so I can pull a new query?
I don't want a reset button. Is this php or Javascript?
thanks,
So I need something like if the user changes the search reset the page to ' '.
thanks,