Created
November 15, 2015 16:31
-
-
Save erinwan/e0191ce68e1742f5c00b to your computer and use it in GitHub Desktop.
ajax handle form error
This file contains 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
$("div.errorlist").remove(); | |
//console.log(response.hasOwnProperty("errors")); | |
if (response.hasOwnProperty("errors")) { | |
//console.log(response["errors"]); | |
$commentInputFormRightDiv = $("li[class='post-item post-comment active'][data-post-id='" + postID + "'] div.row.post-comment-submit div.post-div-right"); | |
for (var key in response["errors"]) { | |
$commentInputFormRightDiv.append($("<div>").html(response["errors"][key]).addClass("errorlist")); | |
} | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment