You add two “});”… see below
your code
function ChangePassword() {
var email = $("#txtForgotPassEmail").val();
if (email == "") {
alert("Please enter the Email ID.")
} else if (!ValidateEmail(email)) {
alert("please enter valid Email ID.")
} else {
$.ajax({
type: "POST",
dataType: "json",
data: {
"email": email
},
url: "/MainIndex/forgotPassword",
success: function(val) {
if (val == "0") {
alert("Please enter the Valid Email ID.")
$("#txtForgotPassEmail").val("");
} else {
$("#ForgotPassDiv").hide();
$("#ChangePassDiv").show();
}
}
});
}
});
}
After change
function ChangePassword() {
var email = $("#txtForgotPassEmail").val();
if (email == "") {
alert("Please enter the Email ID.")
} else if (!ValidateEmail(email)) {
alert("please enter valid Email ID.")
} else {
$.ajax({
type: "POST",
dataType: "json",
data: {
"email": email
},
url: "/MainIndex/forgotPassword",
success: function(val) {
if (val == "0") {
alert("Please enter the Valid Email ID.")
$("#txtForgotPassEmail").val("");
} else {
$("#ForgotPassDiv").hide();
$("#ChangePassDiv").show();
}
}
});
}
/* you add extra }); */
}
solved Error in Ajax Function [closed]