Form Elements Outside the Form
You associate form elements outside form with the form attribute. The form attribute is defined by input, button, and the other form-related elements.
<!DOCTYPE HTML>
<html>
<head>
<title>Example</title>
</head>
<body>
<form id="voteform" method="post" action="http://yourServer/form">
<p>
<label for="fave">Survey: <input autofocus id="fave"
name="fave" /></label>
</p>
</form>
<p>
<label for="name">Name: <input form="voteform" id="name"
name="name" />
</label>
</p>
<button form="voteform" type="submit">Submit Vote</button>
<button form="voteform" type="reset">Reset</button>
</body>
</html>
Home
HTML CSS Book
HTML
HTML CSS Book
HTML
form:
- <form> to get user input
- Using the base Element to Set a Destination for Form Data
- Configuring the HTTP method Attribute for Form element
- Configuring the Form Data Encoding
- Controlling Form Completion
- Specifying a Target for the Form Response
- Setting the Name of the Form
- Adding Labels to a Form
- Automatically Focusing on an input Element
- Disabling Individual input Elements
- Form Elements Outside the Form
Related: