AlfieWebDevTips Homefor new and experienced developers
[Home Home] [Web Development Web Development ] [Code Generators Code Generators ] [Resources Resources ] [Contact Us Contact ] |WebDevTips Privacy Privacy |
Print This Page

You are here : Home - Web Development - HTML - Forms - The Form Tag

The Form Tag



Forms are made up of 2 parts. There's what the user sees and theres underlying code that the browser needs.

FORM

All form fields must be enclosed between
<form action="" method="get" enctype="">
Your form fields go here
</form>
  • action :Here you decide where the form is going to go.
    For example - sending the info to a script
    action="/path/to/the/email/script"
    or sending using mailto
    action="mailto:you@youremail.address"

  • method : method can either be
    method="GET" : this is the default setting and and should be used if sending the form info to a script (this depends on the script)
    OR
    method=POST" POST is used if sending information that, for example, is used to update a database. POST must be used if your action="mailto:you@youremail.address"

  • enctype : Normally you can omit this attribute but there are certain cases where you need to set a value for it.

    enctype="application/x-www-form-urlencoded" This is the default content type used if none specified

    enctype="multipart/form-data" This must be used if you allow uploading of files for example INPUT TYPE="file"

    enctype="text/plain" If you have action="mailto:you@youremail.address" then you must specify text/plain for the email to be legible.

Next we'll look at the text input choices available


how forms work | the form tag | text input
user options | hidden and submit | forms in tables

Why not discuss this article in our forum?
Other related guides : accessible web forms | webpage basics | lists







Google
 

[back to top of page]   

[labelled with icra -  - this link will open in a new window] [RSS Content]

[Copyright © WebDevTips]