Created
May 24, 2020 14:25
-
-
Save JustAyush/e6aab86f0597aaad15ec3c6e4b68d06f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
success: function(response) { | |
// added portion starts here | |
let requredResponse = response.slice(response.length - 12); | |
// added portion ends here | |
if (requredResponse == "Message sent") { // change response to required response | |
$(".form-message").html( | |
"Your message has been submitted successfully" | |
); | |
$(".form-message").css("color", "lightgreen"); | |
$(".form-message").css("opacity", "1"); | |
$(".form-message").show(); | |
$(".form-message") | |
.delay(5000) | |
.fadeTo(1000, 0); | |
$("#form").each(function() { | |
this.reset(); | |
}); | |
} else { | |
$(".form-message").html("Oops. Something went wrong."); | |
$(".form-message").css("color", "#ff9494"); | |
$(".form-message").css("opacity", "1"); | |
$(".form-message").show(); | |
$(".form-message") | |
.delay(5000) | |
.fadeTo(1000, 0); | |
$("#form").each(function() { | |
this.reset(); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment