找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 128|回复: 0

HTML学习指南6

[复制链接]
发表于 2003-11-7 02:12:00 | 显示全部楼层 |阅读模式
HTML学习指南6


The [10]form-fill feature is a proposed enhancement in HTML+ which
Mosaic, Lynx and some other browsers have started to support.

A form is made up of text interspersed with a series of input areas
which the user can fill in, and finally send the completed form to a
destination you (the author) specify. In most cases this destination
is a HTTP server, which will run a script or program to parse (check)
the input data and then file or process it or send it to a specified
email address. Details of how to specify processing are complex and
beyond the scope of this document: you should read (for example) the
[11]NCSA's documentation.

Here is a brief overview of the structure of a form and how to specify
the input areas (fields). If you want to use forms, you need to have
access to a server where you can place the script or program which you
want to process the data.

FORM DEFINITION


A form must be entirely defined within ... tags. The
attributes for the start-tag are:
* method="POST", the only value so far defined (in the NCSA's server
at least, please let me know if you have more information on
others)
* action="url", which specifies the URL of the server and script
which is to do the processing.

For example:

http://abc.edu/htbin-post/myscript";>

INPUT AREAS (FIELDS)


An input area is defined with the tag (defined empty, so
there's no end-tag). This tag takes a variety of attributes which
define the name of the field, what type of input it is, the maximum
length (in the case of text) or a restricted range of values (in the
case of radio or checkbox buttons):
* name="..." lets you name the field (in quotes). This name is
passed to the server script so that field values can be
identified. In the case of repetitive fields like radio buttons,
this name must be repeated identically in each tag;
* type="..." specifies the type of field (in quotes). The main types
are:
+ "text", used for names, addresses or any textual data;
+ "number", used for numeric input;
+ "radio", for multi-choice questions where only one choice can
be activated (this is the `check one only' type of question);
+ "checkbox", for multi-choice questions where any number of
choices can be activated (this is the `check all that apply'
type of question);
+ "reset", to let the user reset all fields to blank or
default;
+ "submit", which the user can activate when the form is
completed and ready to send to the server.
* size=nnn is used with text and number fields to specify the
maximum size of text allowed. Giving two numbers separated by a
comma indicates multi-line text (the first value is the number of
lines, the second the maximum length for all lines);
* value="..." specifies the value that this input area will take on
if activated (use with non-text fields);
* checked can follow the value="..." attribute of a radio or
checkbox field to specify a default. The button is pre-highlighted
to show it is already chosen.

This structure is best shown in an example:
_________________________________________________________________


http://abc.edu/htbin-post/myscript";>

Please answer the following questions:


  1. Name:

  2. Company/Institution:

  3. How did you hear about our product? (check all that apply):
    Newspaper
    Radio
    TV
    Friend/colleague

  4. How many would you like to order? name="Quantity" size=4>

  5. Credit card: AMEX
    Visa
    Mastercard

  6. Number:
    and expiry date (mm/yy):


value=" Reset all values and start over ">




_________________________________________________________________


Please answer the following questions:
1. Name: ________________________________________
2. Company/Institution: ________________________________________
3. How did you hear about our product? (check all that apply):
___Newspaper ___Radio ___TV ___Friend/colleague
4. How many would you like to order? ____
5. Credit card: ___AMEX ___Visa ___Mastercard
6. Number: ________________ and expiry date (mm/yy): _____

________________ _________________________________

_________________________________________________________________
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表