help .html() to show results from ajax call
In the code below I am trying to show the echo statement from a php file. The ajax call works when I use the alert(), but I am trying to put it in a div tag but not working. Help??
- $(document).ready(function(){
//$('#email_error').hide();
$('#form').submit(function(){
var email =$('input#email').val();
var new_password =$('input#new_password').val();
alert(new_password +'and'+ email);
$.ajax({
type: "POST",
url: "update.php",
//cache: false,
data: "email="+ email +"&new_password="+ new_password,
success: function(message){
alert(message);
$('#email_error').html(message);
}
});
});
});