DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Serg has posted 8 posts at DZone. View Full User Profile

HTML Forms

06.28.2010
| 2266 views |
  • submit to reddit
        FORM - With the help of the following elements you can create questionnaires and different fields for text inputting with the possibility of subsequent sending the submitted forms to your server. 

Elements for form creating: 

FORM - creates a form 

TEXTAREA - creates a field for inputting a few lines of text 

SELECT - creates a menu 

OPTION - Creates a separate items of the menu (see SELECT) 

INPUT - creates a field in the form 

FORM - is used to create a form. It should be the presence of initial and ending tags. Inside the FORM element the use of the majority of HTML-elements is allowed. ( <a href=http://phpforms.net/tutorial/html-basics/php-forms.html>PHP form</a> as an example)
NAME - defines the name of the form, unique to this document. Used if there is a few forms in the document. 

ACTION - a required attribute. Specifies the URL for sending the form content - the path to the script of the server that acts in current form. 

METHOD - defines the way to send the contents of the form. Possible values are GET (default) and POST. 

ENCTYPE - defines the method of coding the contents of the form when you send. The default is "application / x-www-form-urlencoded". 

TARGET - defines the name of the window, which returns a result of a submitted form. Possible values: _self, _parent, _top, _blank, or clearly specified the name of the window. Look <a href=http://all4soft.com>all4soft.com</a>

<HTML> 
<body>
 
     <- Creating a form ->
 
     <FORM ACTION="my.php" METHOD="Post" NAME="Form">
 
     <! – Inside the form of creating a text box: ->
 
     Last Name:
 
     <INPUT TYPE="text" name="myname" SIZE="20" VALUE="VALUE">
 
     <! – The "Send" button: ->
 
     <INPUT TYPE="submit" VALUE="Otpravit">
 
     </ FORM>
 
</ body> 
</ HTML>