I am trying to pass the value of a html textbox form field to another .php file using jquery and ajax when the user defocuses that textbox. The textbox has the id "aircraftReg". I am using the code as follows...
$(document).ready(function(){
$("#aircraftReg").blur(function() {
var aircraftReg = $(this).value;
$.get("searchDatabase.php?q=aircraftReg", function(data){
// My function
});
});
});
I think the problem lies in creating the var aircraftReg. I am attempting to assign its value to the text within the text box with id "aircraftReg".
Can anyone see what is going wrong?