Open In App

How to specify the response page after submitting the form using HTML5 ?

Last Updated : 21 Jun, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

In this article, we will specify the response page after submitting the form by using the action attribute in the <form> element in the document. This property is used to specify the URL page or destination of the form data that to be sent to the server after submission of the form. It can be used in the “form” element.

Syntax:

<form action="URL">

Example:




<!DOCTYPE html>
<html>
  
<head>
    <title>
        How to Specify where to display the
        response that is received after 
        submitting the form using HTML5?
    </title>
</head>
  
<body>
    <h1>GeeksforGeeks</h1>
  
    <h2>
        How to Specify where to display the
        response that is received after 
        submitting the form using HTML5?
    </h2>
  
    <form action="test.php" method="post" id="users">
  
        <label for="username">
            Username:
        </label>
  
        <input type="text" name="username" id="Username">
  
        <br>
  
        <label for="password">
            Password:
        </label>
        <input type="password" name="password">
    </form>
    <br>
  
    <button onclick="myGeeks()">
        Submit
    </button>
    <br><br>
  
    <b>
        After Submitting the form-data will sent
        to the "test.php" page on the server.
    </b>
</body>
  
</html>


Output :

Supported Browsers are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads