I need to implement an AJAX call to a JSON routine but I need to pass a dynamic variable so that the response will be filtered. The following source parameter works fine, but the passed variable is not really dynamic in that the value passed is that which was loaded on initialization (its just the way autoComplete works).
Code:
source: 'files_json/auto_Timesheets_Date.php?tsEmpNum=' + $('#ts_EmpNum').val(),
The following source parameter does in fact pass the latest ts_EmpNum BUT the response from the JSON is the HTML code one would see if doing a "View Page Source"
Code:
// Procedure to autocomplete by Dates
$('.autoDate').autocomplete({
minLength: 1,
autoFocus: true,
source: function(request, response) {
$.ajax({
URL: 'files_json/auto_Timesheets_Date.php',
dataType:'json',
data: {
tsEmpNum: $('#ts_EmpNum').val(),
term: request.term
},
success: function( data ) {
response( data );
}
});
},
select:function(evt, ui)
{
form_edit.ts_Date.value = ui.item.tsDate;
form_edit.ts_Status.value = ui.item.tsStatus;
}
});// End of autoDate
Does anyone have a clue as to why the source parameter is returning the HTML and not the JSON data?
Any assistance is greatly appreciated.
jdadwilson
Bookmarks