I have a form forgot password that confirms if the user exists and send a email with a link for password reset, it works fine but i do like that message "email was been sent..." should appear in a popup instead on the same page.
I tried this but does not works:
response.php
var useremail = document.getElementById("email").value();
$.get( "validation.php?email=" function( response ) {
// console.log( response ); // server response
response = response.trim();
if(response == 1){
alert("Email sent....");
} else{
alert(response);
return false;
}
});
}`
Form:
<form class="register" id="email" action="forgot.php" method="post" onSubmit="checkAll();">
mysql
if ($result=="") { $result = "Email has been sent"; }
echo "<div>$result</div>";
}
?>```