HTML
Hypertext Markup Language
There are many attributes available for <form> element which are given below:
The action attribute of <form> element defines the process to be performed on form when form is submitted, or it is a URL to process the form information. This element has sets the URL of the destination object for the anchor.
<title>Skillpundit</title>
</head>
<body>
<form action ="http://skillpundit.com/about-us.php"> <label> User Name: </label><br>
<input type="text" name="name"><br><br>
<label> User Password </label><br>
<input type="password" name="pass"><br><br>
<input type="submit" > </form> <p> It will redirect to a new page "http://skillpundit.com/about-us.php" when you click on submit button </p> </body>
</html>
It will redirect to a new page "http://skillpundit.com/about-us.php" when you click on submit button
The HTML method attribute defines the HTTP method which browser used to submit the form. There are two acceptable values for the method attributes: GET and Post.
- Post: The post method attribute when we want to process the sensitive data as it does not display the submitted data in URL.
- Get: The get method attribute is default value while submitting the form. But this is not secure as it displays data in URL after submitting the form.
<title>Skillpundit</title>
</head>
<body>
<p>This form will be submitted using the GET method</p> <form action ="http://skillpundit.com/about-us.php" method="post" > <label> User Name: </label><br>
<input type="text" name="name"><br><br>
<label> User Password </label><br>
<input type="password" name="pass"><br>
<input type="submit" > </form> </body>
</html>
This form will be submitted using the GET method:
The HTML target attribute defines where to open the response after submitting the form. The following are the keywords used with the target attribute.
<title>Skillpundit</title>
</head>
<body>
<form action ="http://skillpundit.com/about-us.php" target="_blank" > <label> User Name: </label><br>
<input type="text" name="name"><br><br>
<label> User Password </label><br>
<input type="password" name="pass"><br><br>
<input type="submit" > </form> </body>
</html>