Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

PHP Form Mail retains filled page after sending, behind the "Thank You" page...

Participant ,
Dec 17, 2017 Dec 17, 2017

PHP Form Mail, on complete and send, opens the "Message Sent" Thank You page, but when click/swipe back, has also retained the just sent form, fully completed, requiring one to also click/swipe back though two pages to return to main site.

Note: This isn't a problem with receiving multiple mail receipts, but of clearing the initial form on receiving the completion notification page.

Mail delivery works as expected. (The following contact page accessed through the nav menu, not directly.

satgraphics.com  select "contact"

1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 17, 2017 Dec 17, 2017

In this case, the Thank you message is on the same page as your form.  It's not separate.  If you want a separate success/error page, you'll need to use a different script.

I'm not sure why people would hit the BACK button after submitting a form.  Most people would close it.

Nancy

Translate
Community Expert ,
Dec 17, 2017 Dec 17, 2017

You can clear form input fields on submit with JavaScript.

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 17, 2017 Dec 17, 2017

Nancy,

I set an ID and inserted js, but still getting same results.

Inserted at end of form... </form>

    <script>

function myFunction() {

    document.getElementById("SatForm").reset();

}

</script>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 17, 2017 Dec 17, 2017

Are you using PHP echo on the input field values?

value="<?php echo $name; ?>"

If yes, you can remove that string and leave it empty.

value=" "

The only downside is if the form doesn't submit for some reason, the user will have to re-enter their form data.

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 17, 2017 Dec 17, 2017

I removed the string as suggested; problem remains.

I then returned the string; value="<?php echo $name;?>"

By the way, this form is from your blog, alt-web.

satgraphics.com/contact/contact.php

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 17, 2017 Dec 17, 2017

Clear your browser's  cache and try again.

If I type something in the name field and hit SUBMIT, the placeholder text shows but the input value is gone.

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 17, 2017 Dec 17, 2017

Yes, it's true that the field clears; However, if you then try to return to the page from which the visitor came from, there will be behind the fully filled out form... just as it was when the submit button was clicked.

Note content of initial query:

PHP Form Mail, on complete and send, opens the "Message Sent" Thank You page, but when click/swipe back, has also retained the just sent form, fully completed, requiring one to also click/swipe back though two pages to return to main site.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 17, 2017 Dec 17, 2017

In this case, the Thank you message is on the same page as your form.  It's not separate.  If you want a separate success/error page, you'll need to use a different script.

I'm not sure why people would hit the BACK button after submitting a form.  Most people would close it.

Nancy

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 17, 2017 Dec 17, 2017
LATEST

Thanks for your time, Nancy.

I don't know why I didn't think of it at the beginning, but I simply inserted the nav menu from the library, and all works the same, but visitor has the option of going back into any area they might wish to return to.

Thanks for your time.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines