Open in new window. Submit form but stay on same page? - PHP Coding Help - PHP Freaks It's free and open source. I used phpmailer and smtp.php to send email via Gmail, but every time when I hit the submit button, it will redirect the visitor to the new php page, which is not what I want. A form in an HTML document (Web page) can contain an input element with type="file". stay on same page after form submit html. HTML Form - Input Type and Submit Button Example We will get you started. Display html form values in same page after submit using javaScript how to redirect to main page flask. First, get the HTML form var form = document.getElementById ("my-form"). The page is going to have to reload but if you use an anchor it will go to . This article will help you to create a web form that will submit without reloading the page and do the background processes and return values back to the page. I looked for similar discussions and was unable to find anything. Posted on May 21, . Answer (1 of 4): From the coding in the form tag ie in the action tag, you can leave a PHP script for it to post on self. pip3 install django. stay in the same page The form-data can be sent as URL variables (with method="get") or as HTTP post transaction (with method="post" ). Following up, let us move into a more "traditional" method that involved weaving the HTML and server-side script together. Submitting a form to the same page that the form is currently on is very simple. Remain in same page even after submitting the form can anybody help me with that? How to handle AJAX request on the same page - PHP - Makitweb So it is a good practice to use PHP for redirects. Example Project. How to stay in the same page after submit a form in html? After I press "Submit" on a form, I am being transferred to the url that specifies the location of the processing file. Basically as if the form was submitted via AJAX. I'm using a jsp to post data to a servlet, but after posting the data i want to stay back insame jsp. <form action="emailer.php" method="post"> That seems to recirect you to another page. Submitting html form without reload the page - Codexpedia So it is a good practice to use PHP for redirects. 2. Your request handler has three paths: GET, valid POST, invalid POST. 0. About the second one, you need to modify the Visible property of the button and the OnSelect property of the submit button. let both files be on the same page , then the page will be refreshed for every 1 sec after submitting the form. 2. stay on same page after form submit html