autoComplete Source
autoComplete Source
I am using the following code to implement my autoComplete...
- $('.autoDate').autocomplete({
- minLength: 1,
- autofocus: true,
- source: function(request, response) {
- $.getJSON("files_json/auto_Timesheets_Date.php", { tsEmpNum: $('#ts_EmpNum').val() }, response);
- },
- //source: 'files_json/auto_Timesheets_Date.php?tsEmpNum=' + $('#ts_EmpNum').val();
- select:function(evt, ui)
- {
- form_edit.ts_Date.value = ui.item.tsDate;
- form_edit.ts_Status.value = ui.item.tsStatus;
- }
- });// End of autoDate
This method gets the latest value of the ts_EmpNum (red above) and the console log indicates it is passed in the URL string as a $_GET parameter. But, the JSON code does not return any values. If I replace the source with the code in green it works fine (but of course I don't get the latest ts_EmpNum val(). Both forms append the tsEmpNum as value to the URL string.
So, do I need to do something different in the JSON code other than just treat the parameter from the getJSON source as a normal $_GET parameter? Or, is there something I am missing in the implementation.
TIA for any assistance,
jdadwilson