function submit_ajax(){
var name = $("#name").val();
var email = $("#email").val();
var members = $("input[name=members]:checked");
if(name == '' || email == ''){
alert("Please enter both name and email");
return false;
}
if ($('#members').attr('checked')) {
$.post("http://domain.com/capture.php", { email: ""+email+"", name: ""+name+"" },
function(data){
//data is the output of your_php_page.php after it runs
alert("Here is the data returned: " + data);
//you could also write the data on the page too
$("#response").html(data);
});
$.post("http://aweber.com/scripts/addlead.pl", { email: ""+email+"", name: ""+name+"" },
function(data){
//data is the output of your_php_page.php after it runs
//alert("Here is the data returned2: " + data);
//you could also write the data on the page too
$("#response").html(data);
});
}
}
|