I have a $return in php that changes according to what was posted on the form. Here's the JQuery & HTML Code:
$(function() {
$('#query_sort').on('change', function(event) {
var query_sort = $(this).val();
alert(query_sort);
if(query_sort) {
$.ajax({
method: "POST",
url: "/_php/nds/return_criteria_checkbox.php",
data: {query_sort: query_sort}
})
.done(function(data){
alert(<?php echo $query; ?>);
$('#dashboard_table_tbody').html(<?php echo $return; ?>);
});
}
});
});
And for my tbody,
<tbody id = "dashboard_table_tbody" style = "height: 10px;">
<?php echo $return; ?>
</tbody>
Even when I change my form, which gets auto-submitted when it is changed (without refreshing the webpage) the $return changes too, but the HTML page doesn't reflect that change. What Can I do to have it update?
$returnbe changed, that's fine, but how do I reflect that on the webpage without refreshing?$returnchanges, it doesn't reflect the change in$return.