I have a php program that user inputs up to 10 truck drivers codes and selects a date using Jquery date picker.
Then user clicks submit button
Using SQL I pull driver name, and Log Id from the Driver Master PF and date from date picker and load a grid using Jquery.
As I load the grid I am placing driver data in to an array.
At the top of the grid is an add button and a back button.
User validates grid data for the 10 drivers or less and clicks add or back button.
All of the above is working correctly.
On clicking the add button I want to add the records in the array to the Violations PF.
After Goggling and reading for days I decided to place the grid data (that I placed in an array) in a json object.
My problem is how to post the json object to the same URL after user clicks add button.
I believe I know how to decode the json so that I can use SQL to add records to file.
I was not sure if I could just post the data and then using $Post_ retrieve it or if I would have to use a Jquery AJAX Post method.
I am lost as to the method to use and how to go about it.
Any input to point me in right direction would be appreciated.
Quote "I assume that the script calls itself and you are looking to convert $drivers to encoded json? " YES
Quote "But $drivers is not defined?" I define all my variables at beginning on PHP code.
Quote "Maybe you are trying to take the content of $_POST['driver']?" Syntax may be wrong here. My understanding was I could not Post the Array I had to convert it. Is that right or Wrong.
Quote "You also echo $jsondata after assigning it $drivers via the json_encode() to the form which will always be NULL??" ??? I did a print_r after json-encode and data looked good then I remarked out.
Quote "As the $_POST['driver'] field is hidden no user input will ever be collected?" I thought I found an example like this but I see what you are saying.