Html4newbies
Put your hands into html and php
Home
Privacy
About
Contact

Hosting Links
Hosting
Free Php Snippets
Php Snippets 1
Php Snippets 2
Html Tag Form


FORM - user input form

Description :

The <FORM> tag creates an HTML form for user input. It can contain different interface elements, such as text fields, checkboxes, buttons, radio buttons and selection lists. All of these things allow the user to input data which can then be submitted to the server. The different interface elements all have their own tags.

Syntax

<FORM ACTION="serverURL" ENCTYPE="encodingType" METHOD="get|post" NAME="formName" ONRESET="JScode" ONSUBMIT="JScode" TARGET="windowName">

Attributes

ACTION must be used if any action is to occur when the user presses a 'submit' button in the form. It specifies the URL of the program to be invoked when the form is submitted. It can also be a mailto:URL if the form results are to be mailed to someone.
ENCTYPE specifies the MIME encoding of the data sent.
"application/x-www-form-urlencoded" (default) is usually used if the METHOD attribute has the value POST.
"multipart/form-data" is used when the form contains a file upload element (INPUT TYPE="file")

METHOD specifies how information is sent to program invoked by submitting the form.
GET (Default) appends the input information to the URL which on most receiving systems becomes the value of the environment variable QUERY-STRING.
POST sends the input information in a data body that is available on stdin with the data length set in the environment variable CONTENT-LENGTH.

NAME specifies the name of the form. The name is not displayed on the form and it allows JavaScript to differentiate between different forms.
ONRESET specifies the JavaScript code to execute when the RESET button is selected.
ONSUBMIT specifies the JavaScript code to execute when the SUBMIT button is selected. You can use the ONSUBMIT attribute to prevent a form from being submitted; to do so, put a return statement that returns false in the JavaScript code. Any other returned value lets the form submit. If the return statement is omitted, the form is submitted.
TARGET specifies the window that displays the data returned by the invoked program. See A - anchor for more details on attribute TARGET

Copyright © 2002-2017 Html4newbies - HarlandScripts.com NetWork