I have a function where I submit data to another php page that inputs it into the database.
$(document).on('click', '.addNumber', function() {
var newNum = $('input#newNumber').val();
$.ajax({
type: 'POST',
url: '/addNewPhoneNumber.ajax',
data: {
'bid' : bid,
'nbr' : newNum
},
dataType : 'json'
});
});
I need to expand the functionality and add a check on my other php page for submitted number. If it is already in my db I need to return some flag and display a message on the first page. I know how to do that on my second page, but how do I return response back to my initial page?