Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for success before clearing form. #326

Merged
merged 5 commits into from
Aug 26, 2019
Merged

Conversation

mckennapsean
Copy link
Collaborator

Builds on work from #315 to get the changes we can use onto master.

Thanks to @tarasyarema for discovering the fix for this.
Originally pulled from PR #315. Makes sure that the
XHR request is completed and successful before clearing
and hiding the form.
Cleans up console output. Manual logging can
be added by users themselves as desired.
Removed as part of another PR, but I forgot to
remove the unused function. It just checks if there
is a value and returns the result of that if statement,
with unnecessary logging, so clean that all up.
@mckennapsean
Copy link
Collaborator Author

Addressed the merge conflicts, and did some code cleanup in the last two commits (removed another console log statement, and removed a function no longer used).

@mckennapsean mckennapsean requested a review from nelsonic July 28, 2019 21:35
@mckennapsean mckennapsean merged commit d0750f8 into master Aug 26, 2019
var thankYouMessage = form.querySelector(".thankyou_message");
if (thankYouMessage) {
thankYouMessage.style.display = "block";
if (xhr.readyState === 4 && xhr.status === 200) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants