My form doesn't refresh automatically after sent....
Not sure what that means.
In fact when I fill the form I submit and no refresh after I received
thanks you message and my mail onto my gmail but
My name, my message, my email,stay on the form ....
Le mar. 18 sept. 2018 Ã 16:22, Sean McKenna notifications@github.com a
écrit :
Not sure what that means.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/dwyl/learn-to-send-email-via-google-script-html-no-server/issues/283#issuecomment-422412435,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AijcSUpegMzkG8R_283KYDmunhgJcxIOks5ucQGSgaJpZM4WtkzB
.
It is hard to reproduce this. Do you have an example with the failure you mentioned? Can you share it?
In your case... the form is never cleared by our script I think, but you can add this functionality if desired (we simply hide the form and show a thank-you message). This could be why you are seeing what you are seeing.
I have a similar issue with the form.
When I input data in the fields and press SEND button the page doesn't refresh and it does not display thank you message as well, despite the fact that the email is received into my inbox.
Thanks
Can you share an example where this issue is happening?
From what I can tell, @philou2016 in fact did get the thank you message, so this is already different from your issue. My guess is that the main form is not getting hidden and it does not clear the form automatically, this feature needs to be added for your case. An example of this would allow me to help you more easily.
@mckennapsean I have followed each and every step of the tutorial. The output according to the tutorial is correct until step 9.
This is the send button that I am using,
and using the .js file that is provided in the tutorial.
Please tell me what is the issue here. Please also tell me anything you want from the code to help me.
Thanks
If you share any HTML where this issue is occurring, I may be able to help. Our examples work and don't have this issue, so it's likely from a difference in the HTML.
I am using this theme. I have attached the whole project so that it will be easy for you to understand.
theme.zip
Thanks for posting that @KamranArshad11 ! As I expected, your form has no form-elements or thankyou_mesage classes, so the content is not getting hidden nor is a thank you message popping up.
To simply reset the form after a submission, all you have to do is add this line to the onreadystatechange before the final return: form.reset(); Then it will clear the form once it is submitted (though doesn't handle any error cases). This is simple enough for a PR, if you are interested. :+1:
We likely want to make sure that resetting only occurs if the form is successfully submitted. And we could show an error message on failure. If that is beyond scope for someone on this PR, I will follow up and do this.
@mckennapsean thank you very much. You have been very helpful. Thanks a lot
Hi, I know I am also having trouble with my contact form. I think I might have missed a step or two in the instructions, but I would honestly appreciate your help.
The reseting part is not happening and no thank you message is appearing. Have I not entered or linked the code properly? or am I missing a few code elements?
Kind regards.
Have you read the FAQs? They walk through the most common errors I see. I would suggest that, trying to look at the console log, putting breakpoints in the debugger to see if the code is getting hit. Probably isn't.
Just need to add form.reset() within the xhr's onreadystate change function. That worked for me. Anyone can open a PR for it, otherwise I can do it easy peasy.
Thanks @jchesner for sharing that insight!
Most helpful comment
@mckennapsean thank you very much. You have been very helpful. Thanks a lot