In general the form tag has an method “GET” or “POST” that can be associated with and an action. The action is defined by a target URL (relative or absolute) behind which, some piece of software on the server side will pick up and process the data that the user provided through the input elements from withing the form tags on the HTML page.
<form> <input/> <input/> <input/> </form>
This specification does not specify all valid submission methods or content types that may be used with forms. However, HTML 4 user agents must support the established conventions in the following cases:
- If the method is “get” and the action is an HTTP URI, the user agent takes the value of action, appends a `?’ to it, then appends the form data set, encoded using the “application/x-www-form-urlencoded” content type. The user agent then traverses the link to this URI. In this scenario, form data are restricted to ASCII codes.
- If the method is “post” and the action is an HTTP URI, the user agent conducts an HTTP “post” transaction using the value of the action attribute and a message created according to the content type specified by the enctype attribute.
Inputs outside form tags.
You might think that this is invalid:
<form> </form> <div> <input> <input> </div>
And of course it is.
What does it mean? Why are input elements outside a form tag valid.
Actually in the case above the form tags are irrelevant because they have no elements within them.
So a more appropriate notation would be:
<div> <input> <input> </div>
Think of a simple calculator on a Html page – this need no server side processing at all, put it does need input from the user.
What does this mean?
The answer is clustering input using the DOM tree:
This will have the best indication of what inputs belong together from a user perspective. This also has the advantage that a “unique set” can be identified – this means that we can identify the the form as being unique on any leaf of the website tree.
Leave a Comment so far
Leave a comment