Copy link to clipboard
Copied
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"
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
Copy link to clipboard
Copied
You can clear form input fields on submit with JavaScript.
Copy link to clipboard
Copied
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>
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now