Home Web Front-end HTML Tutorial HTML表单标记教程(2):_HTML/Xhtml_网页制作

HTML表单标记教程(2):_HTML/Xhtml_网页制作

May 16, 2016 pm 04:44 PM
information submit Tutorial document Way mark form

本教程介绍FORM表单标记的各种属性在网页设计中的应用.

标记的NAME属性基本语法 01 02 …… 03
语法解释
通过为表单命名可以控制表单与后台程序之间的关系。 文件范例:11-1.htm
在页面中插入表单。
01
02
03
04
05
06
07 插入表单
08
09
10

用户调查


11

12

13
14 文件说明
第11行是表单标记,表单的名称为"invest"。
#p#
标记的ACTION属性基本语法 01 02 …… 03
语法解释
在action属性中定义表单提交的地址。 文件范例:11-2.htm
设置表单的提交地址。
01
02
03
04
05
06
07 设置表单提交地址
08
09
10

用户调查


11

12

13
14 文件说明
第11行是表单标记,表单的名称为invest,将表单内容以电子邮件的方式传送。
#p#
标记的METHOD属性基本语法 01 02 …… 03 语法解释
mothod属性中,get方法是将表单内容附加在url地址后面,所以对提交信息的长度进行了限制,不可以超过8192个字符。如果信息太长将被剪去,从而导致意想不到的处理结果。同时get方法不具有保密性,不适合处理如信用卡卡号等要求保密的内容,而且不能传送非ASCII码的字符。post方法是将用户在表单中填写的数据包含在表单的主体中,一起传送到服务器上的处理程序中,该方法没有字符的限制,它包含了ISO10646的字符集,是一种邮寄的方式,在浏览器的地址栏不显示提交的信息,这种方法传送的数据是没有限制的。当不指明是那种方式时,默认为get方式。
如下代码,就是以get方式提交到tslxg@hotmail.com邮件地址的表单写法:
01
02 ……
03
文件范例:11-3.htm
设置表单的提交方式。
01
02
03
04
05
06
07 设置表单提交方式
08
09
10

用户调查


11

12

13
14 文件说明
第11行是表单标记,表单的名称为invest,将表单的内容以电子邮件的方式传送,并使用get传输方式。
#p#
标记的ENCTYPE属性基本语法 01 02 …… 03
语法解释
value的取值如所下表所示
属性值 描述 Text/plin 以纯文本形式传送信息 Application/x-www-Form-urlencoded 默认的编码形式 Multipart/Form-data 使用mine编码 文件范例:11-4.htm
设置表单信息提交的编码方式。
01
02
03
04
05
06
07 设置信息提交的编码方式
08
09
10

用户调查


11

12

13
14 文件说明
第11行是表单标记,表单的名称为invest,将表单内容以电子邮件的方式传送,并使用get传输方式,以纯文本的形式传送消息。
#p#
标记的TARGET属性基本语法 01 02 …… 03
语法解释
target的取值如下表所示
属性值 描述 _blank 将返回信息显示在新开的浏览器窗口中 _parent 将返回信息显示在父级浏览器窗口中 _self 将返回信息显示在当前浏览器窗口中 _top 将返回信息显示在顶级浏览器窗口中 文件范例:11-5.htm
设置表单信息返回的窗口。
01
02
03
04
05
06
07 设置信息返回的窗口
08
09
10

用户调查


11

12

13
14 文件说明
第11行是表单标记,表单的名称为invest,将表单内容以电子邮件的方式传送,并使用get传输方式,以纯文本形式传送信息,如果有信息返回时,将以新开浏览器窗口的形式显示信息。
标记中,可以包含4个标记,如下表所示
标记 描述 表单输入标记
04
07


各种表单域基本可以满足网站收集信息的要求。如果要求浏览者输入文字信息,如姓名、留言等,可以使用文本字段。如果要求浏览者在固定的范围内进行选择,可以选择单选按纽或者多选按纽,在实际应用中性别、籍贯、爱好常常采用这种方法。有时还会让浏览者提交文件的要求,可以使用文件域,例如某游戏选拔女主人公原型,要求申请者提交照片等。  

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1664
14
PHP Tutorial
1268
29
C# Tutorial
1248
24
Tutorial on how to use Dewu Tutorial on how to use Dewu Mar 21, 2024 pm 01:40 PM

Dewu APP is currently a very popular brand shopping software, but most users do not know how to use the functions in Dewu APP. The most detailed usage tutorial guide is compiled below. Next is the Dewuduo that the editor brings to users. A summary of function usage tutorials. Interested users can come and take a look! Tutorial on how to use Dewu [2024-03-20] How to use Dewu installment purchase [2024-03-20] How to obtain Dewu coupons [2024-03-20] How to find Dewu manual customer service [2024-03-20] How to check the pickup code of Dewu [2024-03-20] Where to find Dewu purchase [2024-03-20] How to open Dewu VIP [2024-03-20] How to apply for return or exchange of Dewu

What to do if the 0x80004005 error code appears. The editor will teach you how to solve the 0x80004005 error code. What to do if the 0x80004005 error code appears. The editor will teach you how to solve the 0x80004005 error code. Mar 21, 2024 pm 09:17 PM

When deleting or decompressing a folder on your computer, sometimes a prompt dialog box "Error 0x80004005: Unspecified Error" will pop up. How should you solve this situation? There are actually many reasons why the error code 0x80004005 is prompted, but most of them are caused by viruses. We can re-register the dll to solve the problem. Below, the editor will explain to you the experience of handling the 0x80004005 error code. Some users are prompted with error code 0X80004005 when using their computers. The 0x80004005 error is mainly caused by the computer not correctly registering certain dynamic link library files, or by a firewall that does not allow HTTPS connections between the computer and the Internet. So how about

How to mark minesweeper? -How to change the difficulty of Minesweeper? How to mark minesweeper? -How to change the difficulty of Minesweeper? Mar 18, 2024 pm 06:34 PM

How to mark minesweeper? First, we need to familiarize ourselves with the marking method in Minesweeper. Normally, there are two common marking methods in Minesweeper games: flag marking and question mark marking. The flag mark is used to indicate that there are mines in the block and is a deterministic mark; while the question mark mark indicates that there may be mines in the block, but it is not deterministic. These two marking methods play an important role in the game, helping players to infer which blocks may contain mines, so as to effectively proceed to the next step. Proficient use of these marking methods can improve the player's success rate in the minesweeper game and reduce the risk of stepping on mines. Therefore, when playing the minesweeper game, if the player has mastered the flag mark and question mark mark, when the player is not sure whether there is a mine in a certain square, he can use the question mark mark to mark it.

How to mark multiple locations on Baidu Maps How to mark multiple locations How to mark multiple locations on Baidu Maps How to mark multiple locations Mar 15, 2024 pm 04:28 PM

There are many functions above, especially for maps that can mark multiple places. When we know some places, we will definitely use some punctuation functions, so that we can bring you a variety of different aspects. Some of the functions you mark will produce distance differences, that is, you can know how far away they are. Of course, some names and detailed information of the above places will also be displayed. However, many netizens may not be familiar with some of the above. The content information is not very clear, so in order to allow everyone to make better choices in various aspects, today the editor will bring you some choices in various aspects, so friends who are interested in ideas, If you are also interested, come and give it a try. Standard

In summer, you must try shooting a rainbow In summer, you must try shooting a rainbow Jul 21, 2024 pm 05:16 PM

After rain in summer, you can often see a beautiful and magical special weather scene - rainbow. This is also a rare scene that can be encountered in photography, and it is very photogenic. There are several conditions for a rainbow to appear: first, there are enough water droplets in the air, and second, the sun shines at a low angle. Therefore, it is easiest to see a rainbow in the afternoon after the rain has cleared up. However, the formation of a rainbow is greatly affected by weather, light and other conditions, so it generally only lasts for a short period of time, and the best viewing and shooting time is even shorter. So when you encounter a rainbow, how can you properly record it and photograph it with quality? 1. Look for rainbows. In addition to the conditions mentioned above, rainbows usually appear in the direction of sunlight, that is, if the sun shines from west to east, rainbows are more likely to appear in the east.

What software is photoshopcs5? -photoshopcs5 usage tutorial What software is photoshopcs5? -photoshopcs5 usage tutorial Mar 19, 2024 am 09:04 AM

PhotoshopCS is the abbreviation of Photoshop Creative Suite. It is a software produced by Adobe and is widely used in graphic design and image processing. As a novice learning PS, let me explain to you today what software photoshopcs5 is and how to use photoshopcs5. 1. What software is photoshop cs5? Adobe Photoshop CS5 Extended is ideal for professionals in film, video and multimedia fields, graphic and web designers who use 3D and animation, and professionals in engineering and scientific fields. Render a 3D image and merge it into a 2D composite image. Edit videos easily

Tutorial on how to turn off the payment sound on WeChat Tutorial on how to turn off the payment sound on WeChat Mar 26, 2024 am 08:30 AM

1. First open WeChat. 2. Click [+] in the upper right corner. 3. Click the QR code to collect payment. 4. Click the three small dots in the upper right corner. 5. Click to close the voice reminder for payment arrival.

PHP Tutorial: How to convert int type to string PHP Tutorial: How to convert int type to string Mar 27, 2024 pm 06:03 PM

PHP Tutorial: How to Convert Int Type to String In PHP, converting integer data to string is a common operation. This tutorial will introduce how to use PHP's built-in functions to convert the int type to a string, while providing specific code examples. Use cast: In PHP, you can use cast to convert integer data into a string. This method is very simple. You only need to add (string) before the integer data to convert it into a string. Below is a simple sample code

See all articles