Staying on page after submitting

html, jquery, php

Solution

- Put your form processing logic on the same page as the form

- Use Ajax

- Redirect back to that page when process.php is done processing the form

Problem

just a question -- How do i actually submit a form and still stay on the same page whilst the script is being executed? I have a simple form that goes like this: ``` <form action="process.php" method="post" id="form"> <label for="name">Name</label> <input type="text" name="name" id="name" required="required" /> <label for="email">Email</label> <input type="email" name="email" id="email" required="required" /> <label for="subject">Subject</label> <input type="text" name="subject" id="subject" required="required" /> <label for="message">Message</label> <input type="text" name="message" id="message" required="required" /> <input type="submit" id="button" value="Submit"/> </form> ``` But everytime i submit the form it just goes to process.php. I don't want that, i want it to stay on the same page, maybe even have a jquery popup saying "thank you" or something. How do i actually stay on the same page whilst the script is being run?

Original source