Actually,i want to send a link to gmail for user forgotpwd.
$('#forgotpwdForm').submit(
function(e)
{
alert("inside Click forgotpwd");
$('#forgotpwdError').empty();
e.preventDefault();
var forgotpwddata=new Object();
forgotpwddata.username=$('#forgotpwdEmail').val();
//forgotpwddata.username=$('#username').val();
//alert(forgotpwddata.username)
var jsonString=JSON.stringify(forgotpwddata);
alert("my json string is : "+jsonString);
alert("Go now");
var forgotpwdURL='http://192.168.2.14:8000/api/School/request_new_password?username='+forgotpwddata.username;
$.ajax({
url: "call-rest-post-ws.php?tmp="+forgotpwdURL,
success: function(data){alert('Got response');
if(data==null || data=='undefined' || data=='null')
{
//alert('Inside data null check');
e.preventDefault();
$('#forgotpwdError').empty();
$('#forgotpwdError').append('<h6 style="color:red"> Failed : Something went wrong, please try again after some time. </h6>');
}
alert('data parse');
var forgotpwdData=JSON.parse(data);
//alert(data);
//alert(forgotpwdData.status);
if(forgotpwdData.status!='success')
{
alert('error display');
e.preventDefault();
$('#forgotpwdError').empty();
$('#forgotpwdError').append('<h6 style="color:red"> Failed : '+forgotpwdData.message+'</h6>');
}
else
{
e.preventDefault();
alert('Inside success');
var URl ='http://localhost/edu-gate/request_new_password.html?email='+data.username +'session='+data.session;
}
}
})
});