|
The HTML Form Tag
The HTML form tag marks the boundaries of a data input form in a web page.
You can have more than one HTML forms in a single page.
However, do not nest HTML forms ( Don't put one form in another form)!
The general syntax of the form tag is given below:
Note: You can create complete web forms using Simfatic Forms. Visually design
the form and Simfatic Forms generates the code.
See: How to make a web form and get it online quickly
Following are the attributes you can have in the form tag:
Action
The HTML form action attribute specifies the URL to submit the
data entered in the HTML form. This will normally be a server side script
written in a scripting language like Perl or PHP.
Example 1 Absolute URL:
Normally, if the form handling script is in the same website, you can
give the relative URL:
Learn about dynamically changing action field in the article: Method
Method of sending data to the action URL. The value is either GET or POST.
In the GET method, the form data is sent as part of the URL like:
handle-data.pl?name=john&email=john@server.com
GET method is suitable for small forms like a search form. For larger forms, use the POST method. Default is the GET method.Enctype
The mime type to be used for encoding the form data.
Some examples are: Target
Specifies the window to be used to load the response of the form submission.
You can use the name of a window or any of the following reserved keywords:
Target field is not mentioned, the response is loaded
in the current window itself.
Opening the response of a form in a new window
If you want to open the response of the form in a new window, you can use
_blank for the target field
The example below is for a form that loads the results of a search in
a new window:
See the code above at work: Name
The name attribute is used to give identification to the form.
For example, if you are using the JavaScript Form Validator,
you will need the name of the form to specify the form validations.
You can find more on HTML Forms in the HTML Form Tutorial |
|
. Copyright © 2003-2009 JavaScript-coder.com. All rights reserved. |
||