Gray Sheep
0
Q:

forms in html

<form action="/action.php">
  <label for="fname">First name:</label><br>
  <input type="text" id="fname" value="Mike"><br><br>
  <label for="lname">Last name:</label><br>
  <input type="text" id="lname" value="Walker"><br><br>
  <input type="submit" value="Submit">
</form>
20

 <form>

    <label for="fname">First name:</label><br>
  <input 
  type="text" id="fname" name="fname"><br>
  <label for="lname">Last 
  name:</label><br>
  <input type="text" id="lname" name="lname">
</form>
 
4
<form action="/action.php">
  <label for="fname">First name:</label><br>
  <input type="text" id="fname" value="Mike"><br><br>
  <label for="lname">Last name:</label><br>
  <input type="text" id="lname" value="Walker"><br><br>
  <input type="submit" value="Submit">
</form>

Html By Duco Defiant Dogfish on Feb 11 2020
<form action="/action_page.php">
  First name:<br>
  <input type="text" name="firstname" value="Mickey"><br>
  
  Last name:<br>
  <input type="text" name="lastname" value="Mouse"><br><br>
  
  <input type="submit" value="Submit">
</form> 
5
<html>
<form action= "your site" method = "post/get">
  </form>
</html>
  
5
<form action="/action_page.php">
  First name:<br>
  <input type="text" name="firstname" value="Mickey"><br>
  
  Last name:<br>
  <input type="text" name="lastname" value="Mouse"><br><br>
  
  <input type="submit" value="Submit">
</form> 
9
The <form> tag is used to create an HTML form for user input.

The <form> element can contain one or more of the following form elements:

<input>
<textarea>
<button>
<select>
<option>
<optgroup>
<fieldset>
<label>
<output>

form tag main attributes 
 1. action : contains url of the page where form data get redirected on submit button click
 2. method : contains method in which way it tranfer the data i.e get,post
  
    a. get : this method shows the form data along the url in browser address bar
    b. post : this method does not show any form data in url it transfer data in hidden form
---------------------------------------------------------------------------------------------
  
Example below : 
//An HTML form with two input fields and one submit button:
    <form action="/action_page.php" method="get">
      <label for="fname">First name:</label>
      <input type="text" id="fname" name="fname"><br><br>

      <label for="lname">Last name:</label>  
      <input type="text" id="lname" name="lname"><br><br>

      <input type="submit" value="Submit">
    </form>
 
2
!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>learning forms</title>
</head>
<body>
    <form>
        <div>
        <label>name</label>
        <input>
        </div>
    </form>
</body>
</html>
1

 <form>

  
 First name:<br>
  <input type="text" name="firstname"><br>

  
 Last name:<br>
  <input type="text" name="lastname">

 </form>
 
3

New to Communities?

Join the community