HTML forms. Creating HTML forms All about forms in html


Forms can be found on almost every website on the Internet. For example, when you enter your login and password on a website, the data is filled out through forms and sent to the server. Also an example of a form are various surveys.

Tag syntax

...

Tag

has a very important action attribute, which is assigned the address (URL) of the script to which the received information from the form is sent for processing. We will not go into detail about what happens after the data is sent, since these issues are already resolved not by html, but by the GET and POST methods in PHP.

Example 1. HTML form with buttons

These will be the buttons:
Button one
Button two
Button three
And this will be a text field. For example, you can enter your login here

And this will be a large text field. For example, you can enter information about yourself here

After all of the above there will be an OK button

After clicking OK, the page will simply refresh, because... we did not specify the action parameter

Converts to the following on the page:

Explanations for example

  • action="" - indicates that data processing will take place on the same page.
  • - the type="radio" attribute indicates that you need to display the text after this code as a selection button. The name and value attribute in this tag now play a small role for us, because We are not studying php now (see php lessons).
  • - the type="text" attribute indicates that this will be a text field. There are also two important attributes here: name (for php) and value (default value).
  • - the type="textarea" attribute indicates that this will be a large text field. The only difference from the previous case is that it allows you to record a large amount of text.
  • - the type="submit" attribute indicates that this is a button. The value attribute contains what will be written on the button.

You can read more about all these elements in lesson 15: tag elements

, where radio buttons, lists, checkboxes, text fields, buttons are considered.

Now let's take a closer look at all the tag attributes .

Tag Attributes and Properties

1. Attribute accept-charset="Encoding"- defines the encoding in which the server can accept and process form data. Can take various values, for example, CP1251, UTF-8, etc.

2. The action="URL" attribute is the address of the script that processes the transmitted data from the form. If you leave this value empty, the data will be processed in the same document where the form is located.

3. Attribute autocomplete="on/off" - sets or disables autocomplete of the form. Can take two values:

  • on - enable autofill;
  • off - disable autofill;

4. Attribute enctype="parameter" - specifies the data encoding method. Can take the following values:

  • application/x-www-form-urlencoded- spaces are replaced with +, characters like Russian letters are encoded with their hexadecimal values
  • multipart/form-data - data is not encoded
  • text/plain - spaces are replaced with a + sign, letters and other characters are not encoded.

5. Method="POST/GET" attribute - specifies the sending method. Can take two values:

  • GET - data transmission in the address bar (there is a limitation on the volume of data sent)
  • POST - sends data to the server in a browser request (can send a large amount of data, since there is no volume limitation)

6. Attribute name="name" - sets the name of the form. Most often used when there are multiple forms so that you can access a specific form through a script.

7. The novalidate attribute - cancels the built-in check of form data for correctness of input.

8. The target="parameter" attribute is the name of the window or frame where the handler will load the returned result. Can take the following values:

  • _blank - loads the page into a new browser window
  • _self - loads the page into the current window
  • _parent - loads the page into the parent frame
  • _top - cancels all frames and loads the page in the full browser window

Dear reader, now you have learned much more about the html form tag. Now I advise you to move on to the next lesson.

...form contents...

  • Just inside the form element there should be controls, of which there can be as many as desired.
  • Form attributes:

    • The action attribute specifies a server file with a script responsible for the main processing of data sent from the form. Typically, the code for this file is written in a server-side programming language, for example, in php or perl.
    • The enctype attribute indicates the type of information transmitted to the server, if it is just text data - text/plain, if files are sent with the form, then multipart/form-data should be specified.
    • The method attribute specifies and defines the form of data transfer. We will not dwell on this in detail, but it should be said that for more reliable transmission, the post method should be specified.

    HTML form elements

      <input type = "text" name = "login" size = "20" value = "Login" maxlength = "25" > !}

      Result:

      • The value of the type attribute - text - indicates that this is a text field
      • size — size of the text field in characters
      • maxlength — maximum number of characters that can fit in the field
      • value - initial text in the text field
      • name — element name, necessary for processing data in the handler file

      Result:


      Instead of text, a mask is displayed in the field - stars or circles

      <input type = "submit" value = "Send data">

      Result:

      The submit button collects all form data entered by the user and sends it to the address specified in the action attribute of the form.

      <input type = "reset" value = "Clear form" > !}

      Result:

      The button returns the state of all controls to their original state (clears the form)

      <input type = "checkbox" name = "asp" value = "yes" > !} A.S.P.<br> <input type = "checkbox" name = "js" value = "yes" checked = "checked" > !} javascript<br> <input type = "checkbox" name = "php" value = "yes" > !} PHP<br> <input type = "checkbox" name = "html" value = "yes" checked = "checked" > !} HTML<br>

      A.S.P.
      javascript
      PHP
      HTML


      Result:

      A.S.P.
      javascript
      PHP
      HTML

      In html, a checkbox is used to organize multiple selection, i.e. when it is necessary and possible to select several answer options

      <input type = "radio" name = "book" value = "asp" > !} A.S.P.<br> <input type = "radio" name = "book" value = "js" > !} Javascript<br> <input type = "radio" name = "book" value = "php" > !} PHP<br> <input type = "radio" name = "book" value = "html" checked = "checked" > !} HTML<br>

      A.S.P.
      Javascript
      PHP
      HTML

      Result:

      A.S.P.
      Javascript
      PHP
      HTML

      radio button html serves for a single choice from several options

      The checked attribute immediately sets the element as checked

    Important: For elements radio it is necessary that the attribute value name all elements in the group were the same: in this case, the elements will work interconnected, when one element is turned on, the others will be turned off

    HTML Dropdown List

    Let's look at an example of adding a drop-down list:

    1 2 3 4 5 6 <select name = "book" size = "1" > <option value = "asp" > !} A.S.P.</option> <option value = "js" > !} JavaScript</option> <option value = "php" > !} PHP</option> <option value = "html" selected = "selected" > !} HTML</option> </select>

    Result:

    • The drop-down list consists of a main tag - select - which has a closing pair, and each list item is an option tag, inside which the text of the item is displayed
    • size attribute with value "1" indicates that the collapsed list displays one item, the rest are opened by clicking on the menu arrow
    • The selected attribute of an item (option) indicates that this particular item will be initially visible, and the remaining items are “collapsed”

    For large and complex lists there is an option add subheadings— optgroup tag with label attribute:

    1 2 3 4 5 6 7 8 9 10 11 12 <select name = "book" size = "1" > <optgroup label = "English" > <option value = "asp" > !} A.S.P.</option> <option value = "js" > !} JavaScript</option> <option value = "php" > !} PHP</option> <option value = "html" selected = "selected" > !} HTML</option> </optgroup> <optgroup label = "Russians" > <option value = "asp_rus" > !} ASP in Russian</option> <option value = "js_rus" > !} JavaScript in Russian</option> </optgroup> </select>


    To provide the opportunity selecting several items at once you need to add the multiple attribute. But in this case, the size attribute should also be set to a value greater than 1:

    Result:

    • The width of the element depends on the cols attribute, which specifies how many characters will fit horizontally
    • The rows attribute specifies the number of rows in an element

    Other elements

    Additional elements and attributes

    • For controls radio And checkbox It’s convenient to use additional elements that, firstly, bind the text to the radio or checkbox element itself, and secondly, add a stroke when clicked:
    • <input type = "checkbox" id = "book1" > <label for = "book1" > A.S.P.</label>

      In the example, an inscription (label tag) has been created for the checkbox element. The binding is carried out through the id attribute, the value of which is specified in the for attribute of the label.

      Result:

    • The disabled attribute allows you to lock an element, making it unchangeable by the user:
    • <input type = "text" name = "login" size = "20" value = "Login" maxlength = "25" disabled = "disabled" >!}
      <input type = "checkbox" name = "asp" value = "yes" > !} A.S.P.<br> <input type = "checkbox" name = "js" value = "yes" checked = "checked" disabled = "disabled" > !} javascript<br>


      A.S.P.
      javascript

    HTML forms are controls that are used to collect information from website visitors.

    Web forms consist of a collection of text fields, buttons, lists, and other controls that are activated by a mouse click. Technically, forms pass data from the user to a remote server.

    To receive and process form data, web programming languages ​​such as PHP, Perl.

    Before the advent of HTML5, web forms were a collection of several elements , ending with a button . It took a lot of effort to style forms across different browsers. Additionally, the forms required JavaScript to validate input and lacked specific input field types for specifying everyday information such as dates, email addresses, and URLs.

    HTML5 forms solved most of these common problems with the presence of new attributes, providing the ability to change the appearance of form elements by CSS3.

    Rice. 1. Improved Web Forms with HTML5

    Creating an HTML5 Form

    1. Element

    The basis of any form is the element .... It does not require any input as it is a container, holding all the form controls together - fields. The attributes of this element contain information that is common to all form fields, so fields that are logically combined must be included in one form.

    Table 1. Tag attributes
    Attribute Meaning/Description
    accept-charset The attribute value is a space separated list of character encodings, which will be used to submit the form, for example, .
    action Required attribute, which specifies the url of the form handler on the server to which the data is sent. It is a file (for example, action.php) that describes what needs to be done with the form data. If the attribute value is not specified, then after the page is reloaded, the form elements will take on their default values.
    If all the work will be done on the client side by JavaScript scripts, then you can specify the value # for the action attribute.
    You can also arrange for the form filled out by the visitor to be sent to you by email. To do this you need to make the following entry:
    autocomplete

    enctype Used to indicate MIME-type of data sent along with the form, for example, enctype="multipart/form-data" . Specified only in the case of method="post" .
    application/x-www-form-urlencoded is the default content type, indicating that the data passed represents a list of URL-encoded form variables. Space characters (ASCII 32) will be encoded as + , and a special character such as ! will be encoded in hexadecimal as %21 .
    multipart/form-data - used to submit forms containing files, non-ASCII data and binary data, consists of several parts, each of which represents the content of a separate form element.
    text/plain - indicates that plain (not html) text is being transmitted.
    method Specifies how form data is submitted.
    The get method passes data to the server through the browser's address bar. When generating a request to the server, all variables and their values ​​form a sequence like www.anysite.ru/form.php?var1=1&var2=2 . Are variable names and values ​​appended to the server address after the sign? and are separated by &. All special characters and non-Latin letters are encoded in the format %nn, the space is replaced by +. This method should be used if you are not transferring large amounts of information. If you are supposed to send a file along with the form, this method will not work.
    The post method is used to send large amounts of data, as well as confidential information and passwords. The data sent using this method is not visible in the URL header because it is contained in the body of the message.
    name Sets form name, which will be used to access form elements via scripts, such as name="opros" .
    novalidate Disables validation in the form submit button. The attribute is used without specifying a value
    target Specifies the window to which the information will be sent:
    _blank - new window
    _self - the same frame
    _parent — parent frame (if it exists, if not, then to the current one)
    _top is the top-level window relative to this frame. If the call does not come from a child frame, then to the same frame.

    2. Grouping form elements

    Element

    ...
    designed to group elements related to each other, thus dividing the form into logical fragments.

    Each group of elements can be named using the element , which comes immediately after the tag

    . The group name appears in the left upper border
    . For example, if in an element
    Contact information is stored:

    Contact Information


    Rice. 2. Grouping form elements using

    Table 2. Tag attributes
    Attribute Meaning/Description
    disabled If the attribute is present, then a group of related form elements located inside the container
    , disabled for filling and editing. Used to restrict access to certain form fields containing previously entered data. The attribute is used without specifying a value -
    .
    form
    in the same document. Indicates one or more forms to which this group of elements belongs. The attribute is not currently supported by any browser.
    name Defines Name, which will be used to reference elements in JavaScript, or to reference form data after the form has been filled out and submitted. It is analogous to the id attribute.

    3. Create form fields

    Element creates most form fields. An element's attributes differ depending on the type of field the element is used to create.

    Using CSS styles you can change the font size, font type, color and other properties of the text, as well as add borders, background color and background image. The width of the field is specified by the width property.

    Table 3. Tag attributes
    Attribute Meaning/Description
    accept Determines the type of file allowed to be sent to the server. Indicated only for . Possible values:
    file_extension - allows downloading files with the specified extension, for example, accept=".gif" , accept=".pdf" , accept=".doc"
    audio/* - allows downloading audio files
    video/* - allows downloading video files
    image/* - allows loading images
    media_type - indicates the media type of the downloaded files.
    alt Defines alternative text for images, indicated only for .
    autocomplete Responsible for remembering the values ​​entered into the text field and automatically substituting them the next time you enter them:
    on - means that the field is not protected and its value can be stored and retrieved,
    off - disables autofill for form fields.
    autofocus Allows you to make sure that in the loaded form one or another input field already has focus (has been selected), being ready to enter a value.
    checked The attribute checks whether the default checkbox is checked on page load for fields like type="checkbox" and type="radio" .
    disabled
    form The attribute value must be equal to the element's id attribute in the same document. Identifies one or more forms to which this form field belongs.
    formaction Specifies the url of the file that will process the data entered into the fields when submitting the form. Set only for fields of type="submit" and type="image" . The attribute overrides the value of the action attribute of the form itself.
    formenctype Determines how form field data will be encoded when sent to the server. Overrides the value of the form's enctype attribute. Set only for fields of type="submit" and type="image" . Options:
    application/-x-www-form-urlencoded is the default value. All characters are encoded before sending (spaces are replaced with the + character, special characters are converted to ASCII HEX values)
    multipart/form-data - characters are not encoded
    text/plain - spaces are replaced with the + symbol, and special characters are not encoded.
    formmethod The attribute specifies the method the browser will use to submit form data to the server. Set only for fields of type="submit" and type="image" . Overrides the value of the form's method attribute. Options:
    get is the default value. The data from the form (name/value pair) is added to the url and sent to the server: URL?name=value&name=value
    post - form data is sent as an http request.
    formnovalidate Specifies that form field data should not be validated when the form is submitted. Overrides the value of the form's novalidate attribute. Can be used without specifying an attribute value.
    formtarget Determines where to display the response received after submitting the form. Set only for fields of type="submit" and type="image" . Overrides the value of the form's target attribute.


    _parent – ​​loads the response into the parent frame
    _top – loads the response in full screen
    framename – loads the response into a frame with the specified name.
    height The attribute value contains the number of pixels without specifying a unit of measurement. Sets the height of a form field of type type="image" , for example, . It is recommended to set both the height and width of the field at the same time.
    list Is a reference to an element , contains its id . Allows you to provide the user with several options to choose from when he begins to enter a value in the corresponding field.
    max Allows you to limit the allowed input of numeric data to a maximum value; the attribute value can contain an integer or fractional number. It is recommended to use this attribute in conjunction with the min attribute. Works with the following field types: number, range, date, datetime, datetime-local, month, time and week.
    maxlength The attribute specifies the maximum number of characters entered in the field. The default value is 524288 characters.
    min Allows you to limit the allowed numeric input to a minimum value.
    multiple Allows the user to enter multiple attribute values, separated by a comma. Applies to files and email addresses. Specified without attribute value.
    name Specifies the name that will be used to access the element , for example, in css style sheets. It is analogous to the id attribute.
    pattern Allows you to determine using regular expression the syntax of the data that must be allowed to be entered in a particular field. For example, pattern="(3)-(3)" - square brackets set the range of acceptable characters, in this case - any lowercase letters, the number in curly brackets indicates that three lowercase letters are needed, followed by a dash, then three digits in the range from 0 to 9.
    placeholder Contains the text that is displayed in the input field before it is filled in (most often this is a tooltip).
    readonly Does not allow the user to change the values ​​of form elements; selecting and copying text is still available. Specified without attribute value.
    required Displays a message indicating that this field is required. If the user tries to submit the form without entering the required value in this field, a warning message will be displayed on the screen. Specified without attribute value.
    size Sets the visible width of the field in characters. The default value is 20. Works with the following field types: text, search, tel, url, email and password.
    src Specifies the url of the image used as the form submit button. Indicated only for the field .
    step Used for elements that require the input of numeric values, indicates the amount by which the values ​​are increased or decreased during the range adjustment process (step).
    type button - creates a button.
    checkbox - turns an input field into a checkbox that can be checked or cleared, e.g.
    I have a car
    color - Generates color palettes in supporting browsers, allowing users to select color values ​​in hexadecimal format.
    date — allows you to enter a date in the format dd.mm.yyyy.
    Birthday:
    datetime-local - allows you to enter a date and time separated by a capital English letter T using the pattern dd.mm.yyyy hh:mm.
    Birthday - day and time:
    email - Browsers that support this attribute will expect the user to enter data that matches the syntax of email addresses.
    Email:
    file - allows you to download files from the user's computer.
    Choose File:
    hidden - Hides the control, which is not displayed by the browser and prevents the user from changing the default values.
    image - creates a button, allowing you to insert an image instead of text on the button.
    month - Allows the user to enter the year and month number using the yyyy-mm pattern.
    number - intended for entering integer values. Its min , max , and step attributes specify the upper, lower limits, and step between values, respectively. These attributes are assumed for all elements that have numerical indicators. Their default values ​​depend on the element type.
    Please indicate quantity (from 1 to 5):
    password - creates text fields in the form, while the characters entered by the user are replaced with asterisks, bullets, or other icons installed by the browser.
    Enter password:
    radio - creates a switch - a control in the form of a small circle that can be turned on or off.
    Vegetarian:
    range - will allow you to create an interface element such as a slider, min / max - will allow you to set the selection range
    reset - creates a button that clears form fields of user entered data.
    search - denotes a search field, by default the input field is rectangular in shape.
    Search:
    submit - creates a standard button that is activated by a mouse click. The button collects information from the form and submits it for processing.
    text - Creates text fields on a form, outputting a single-line text field for text input.
    time - allows you to enter time in 24-hour format using the hh:mm pattern. In supporting browsers, it appears as a numeric input field control with a mouse-editable value and only allows time values ​​to be entered.
    Specify time:
    url—the field is intended for specifying URLs.
    Home page:
    week - The corresponding pointer tool allows the user to select one week of the year, after which it will provide data entry in nn-yyyy format. Depending on the year, the number of weeks can be 52 or 53.
    Specify week:
    value Determines the text that appears on a button, in a field, or in associated text. Not specified for fields of type file.
    width The attribute value contains the number of pixels. Allows you to set the width of the form fields.

    4. Text input fields

    Element used instead of element when you need to create large text fields. The text displayed as the original value is placed inside the tag. The field dimensions are set using the attributes cols - horizontal dimensions, rows - vertical dimensions. The height of the field can be set using the height property. All sizes are calculated based on the size of one character in a monospace font.

    Table 4. Tag attributes

    7. Buttons

    Element creates clickable buttons. Unlike buttons created ( , , , ), inside the element .

    Buttons allow users to submit data to a form, clear form content, or take some other action. You can create borders, change the background, and align text on a button.

    Table 9. Tag attributes
    Attribute Meaning/Description
    autofocus Sets focus to the button when the page loads.
    disabled Disables the button, making it unclickable.
    form Indicates one or more forms to which this button belongs. The attribute value is the identifier of the corresponding form.
    formaction The attribute value contains the URL of the form data handler sent when the button is clicked. Only for button type type="submit" . Overrides the value of the action attribute specified for the element .
    formenctype Sets the encoding type of form data before sending it to the server when buttons like type="submit" are clicked. Overrides the value of the enctype attribute specified for the element . Possible values:
    application/x-www-form-urlencoded is the default value. All characters will be encoded before sending.
    multipart/form-data - characters are not encoded. Used when files are uploaded using a form.
    text/plain - characters are not encoded, and spaces are replaced with the + symbol.
    formmethod The attribute specifies the method the browser will use to submit the form. Overrides the value of the method attribute specified for the element . Specified only for buttons of the type="submit" type. Possible values:
    get - data from the form (name/value pair) is added to the url and sent to the server. This method has limitations on the size of the data sent and is not suitable for sending passwords and confidential information.
    post - data from the form is added as an http request. The method is more reliable and secure than get and has no size restrictions.
    formnovalidate The attribute specifies that form data should not be validated upon submission. Specified only for buttons of the type="submit" type.
    formtarget The attribute specifies in which window to display the result after submitting the form. Specified only for buttons of the type="submit" type. Overrides the value of the target attribute specified for the element .
    _blank - loads the response into a new window/tab
    _self - loads the response into the same window (default)
    _parent - loads the response into the parent frame
    _top - loads the response in full screen
    framename - loads the response into a frame with the specified name.
    name Sets the name of the button, the attribute value is text. Used to link to form data after the form has been submitted, or to link to a given button(s) in JavaScript.
    type Defines the button type. Possible values:
    button - clickable button
    reset — reset button, returns the original value
    submit - button for submitting form data.
    value Sets the default value sent when the button is clicked.

    8. Checkboxes and radio buttons in forms

    Checkboxes in forms are set using the construct , and the switch - using .

    Checkboxes, unlike radio buttons, can be set to several in one form. If the checked attribute is specified for checkboxes, then when the page loads, the checkboxes on the corresponding form fields will already be selected.

    Element

    HTML form is a tool with which an HTML document can send some information to some predetermined point in the outside world, where the information will be processed in some way.

    It is quite difficult to talk about forms in a tutorial dedicated to HTML. The reason is very simple: creating an HTML form is much easier than creating the "point in the outside world" to which the HTML form will send information. In most cases, such a “point” is a program written in Perl or C.

    Programs that process data submitted by forms are often called CGI scripts. The acronym CGI stands for Common Gateways Interface. Writing CGI scripts in most cases requires a good knowledge of the corresponding programming language and the capabilities of the Unix operating system.

    Currently, the PHP/FI language has become somewhat widespread, the instructions of which can be embedded directly into HTML documents (the documents are saved as files with the extension *.pht or *.php).

    HTML forms pass information to handler programs in the form of [variable name]=[variable value] pairs. Variable names should be specified in Latin letters. Variable values ​​are treated as strings by handlers, even if they contain only numbers.

    How the HTML form works

    The form is opened with the tag and ends with the tag. An HTML document can contain several forms, but the forms should not be located one inside the other. HTML text, including tags, can be placed inside forms without restrictions.

    Tag

    may contain three attributes, one of which is required. These are the attributes:

    Required attribute. Determines where the form handler is located.

    Determines how (in other words, using which hypertext transfer protocol method) data from the form will be transferred to the handler. Valid values ​​are METHOD=POST and METHOD=GET . If the attribute value is not set, METHOD=GET is assumed by default.

    Determines how data from the HTML form will be encoded for transmission to the handler. If the attribute value is not set, the default is ENCTYPE=application/x-www-form-urlencoded .

    The simplest HTML form

    In order to start the process of transferring data from the form to the handler, some kind of control is needed. Creating such a control body is very simple:

    Having encountered such a line inside the form, the browser will draw a button on the screen with the inscription Submit (read “submit” with an emphasis on the second syllable, from the English “submit”), when clicked, all data available in the form will be transferred to the handler defined in the tag .

    The label on the button can be set to whatever you like by entering the attribute VALUE="[Label]" (читается "вэлью" с ударением на первом слоге, от английского "значение"), например:!}

    Now we know enough to write a simple HTML form (example 11). It will not collect any data, but will simply return us to the text of this chapter.

    Example 11

    Simplest form

    The inscription placed on the button can, if necessary, be passed to the handler by introducing the NAME=[name] attribute into the button definition (read “name”, from English “name”), for example:

    When you click on such a button, the handler, along with all other data, will receive a button variable with the value Let's go! .

    A form can have multiple submit buttons with different names and/or values. The handler can thus act differently depending on which submit button the user clicked.

    How an HTML form collects data

    There are other types of elements . Each element must include the NAME=[name] attribute, which specifies the name of the element (and, accordingly, the name of the variable that will be passed to the handler). The name must be specified only in Latin letters. Most items must include the attribute VALUE="[value]" , определяющий значение, которое будет передано обработчику под этим именем. Для элементов !} And , however, this attribute is optional because the value of the corresponding variable can be entered by the user using the keyboard.

    Basic element types :

    TYPE=text

    Defines a window for entering a line of text. May contain additional attributes SIZE=[number] (width of the input window in characters) and MAXLENGTH=[number] (maximum allowed length of the input string in characters).

    Example:

    Defines a 20-character wide window for text entry. By default, the window contains the text Ivan, which the user can edit. The edited (or unedited) text is passed to the handler in the user variable.

    TYPE=password

    Defines a window for entering a password. Absolutely similar to the text type, only instead of symbols of the entered text it shows asterisks (*) on the screen. Example:

    Defines a 20-character wide window for entering a password. The maximum allowed password length is 10 characters. The entered password is passed to the handler in the pw variable.

    TYPE=radio

    Defines a radio button. May contain an additional checked attribute (indicates that the button is checked). In a group of radio buttons with the same names, there can be only one labeled radio button.

    Example:

    9600 bps
    14400 bps
    28800 bps

    Defines a group of three radio buttons labeled 9600 bps, 14400 bps, and 28800 bps. The first of the buttons is initially labeled. If the user does not check another button, the modem variable with the value 9600 will be passed to the handler. If the user checks another button, a modem variable with a value of 14400 or 28800 will be passed to the handler.

    TYPE=checkbox

    Defines a square in which a mark can be made. May contain an additional checked attribute (indicates that the square is checked). Unlike radio buttons, a group of squares with the same name can have multiple labeled squares.

    Example:

    Personal computers
    Workstations
    Local network servers
    Internet Servers

    Defines a group of four squares. The second and fourth squares are initially marked. If the user makes no changes, two variables will be passed to the handler: comp=WS and comp=IS .

    TYPE=hidden

    Defines a hidden data element that is not visible to the user when filling out the form and is passed to the handler unchanged. It is sometimes useful to have such an element on a form that is redesigned from time to time so that the handler knows which version of the form it is dealing with. You can easily come up with other possible uses yourself.

    Example:

    Defines a hidden version variable that is passed to the handler with the value 1.1.

    TYPE=reset

    Defines a button that, when clicked, returns the HTML form to its original state. Since no data is passed to the handler when using this button, a reset button may not have a name attribute.

    Example:

    Defines a Clear Form Fields button that, when clicked, returns the HTML form to its original state.

    Besides the elements , HTML forms can contain menus

    All attributes are required. The NAME attribute defines the name under which the contents of the window will be transferred to the handler (in the example - address). The ROWS attribute sets the height of the window in rows (5 in the example). The COLS attribute sets the width of the window in characters (50 in the example).

    Text placed between tags , represents the default contents of the window. The user can edit it or simply erase it.

    It is important to know that Russian letters are in the window