phpretarded Posted June 1, 2012 Share Posted June 1, 2012 Hello I have 3 select lists, and while I have always used another php page to process the results which I get with $_POST['whatever'] now it turns out that in order to do pagination of results I need to be able to get those selected values right where the Select lists are, and not in the php processing page. I don't know how to pick them up, because only upon clicking the Submit button are they sent and recovered by the $_POST (or get or request). I am going to be using Datatables to paginate, but, as I see the code, it needs to have the selected values right on the Select Lists page as I said. This is the code. Look for the word Krakow. Well, that is where the selected value from the Selected list should be... Any ideas on how to paginate when you are getting results where the WHERE clause of your sql query is what you get from the Selected lists? I have paginated easily when I do a query without WHEREs. <script language= language="JavaScript" type="text/javascript"> $(document).ready(function() { $('#shops').dataTable( { "bProcessing": true, "bServerSide": true, "bJQueryUI": true, "sPaginationType": "full_numbers", "sAjaxSource": "datatables/php/server_processing_shops.php", "fnServerData": function ( sSource, aoData, fnCallback ) { /* Add some extra data to the sender */ aoData.push( { "name": "town_shop", "value": "Krakow" } ); $.getJSON( sSource, aoData, function (json) { /* Do whatever additional processing you want on the callback, then tell DataTables */ fnCallback(json) } ); } } ); } ); </script> Quote Link to comment https://forums.phpfreaks.com/topic/263499-getting-the-selected-values-from-select-lists-on-the-same-page/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.