Is is possible to use AJAX on an onblur event from a textfield. I'd like html (inside a div container) to change whenever I tab out of a textfield. I see a lot of questions/tutorials using AJAX with forms but not on the individual components such as textfield or checkbox.
You can do it using plain JQuery. Assuming your form element has the ID of my_element:
$("#my_element").blur(function(){
$.ajax({url: '/my/data', type: 'GET'})
.done(function(response){
$("#my_div").html(response);
})
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With