I have 3 inputs that I need to check if any are empty and then run an ajax call.
Could someone assist write the IF statement
$('input[name=newsave]').click(function(){
var neworgy = $('input[name=neworg]').val();
var newurly = $('input[name=newurl]').val();
var newtrackingy = $('input[name=newtracking]').val();
var dataString = 'email=<?php echo $userid;?>&neworg='+ neworgy +'&newurl='+ newurly +'&newtracking='+ newtrackingy;
$.ajax({
type: "POST",
url: "new-token.php",
data: dataString,
success: function() {
location.reload();
}
});
});
For the query string you can use the jQuery
serialize()function.