📄 表单 标记.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0040)http://www.zjou.edu.cn/te/html/form.html -->
<HTML><HEAD><TITLE>HTML 语言教程</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2719.2200" name=GENERATOR></HEAD>
<BODY>
<H1 align=center>表单(FORM)标记(TAGS)</H1>
<CENTER>
<P>
<HR>
<P></P></CENTER>
<P><!--################## Basic ########################--><A
name=basic></A></P>
<H2><IMG height=20 alt=+ src="表单 标记.files/br20t.gif" width=20 align=top
tppabs="http://webclass/html/br20t.gif"> 基本语法</H2>
<P><!------Form Basic-------></P>
<H3>表单的基本语法</H3>
<DL>
<H3><TT><form action="url" method=*><BR>... <BR>... <BR><input
type=submit> <input type=reset><BR></form> </TT></H3>
<P><TT>*=GET, POST </TT></P></DL><PRE></PRE>
<P><!------Input Basic-------></P>
<H3>表单中提供给用户的输入形式</H3>
<DL>
<H3><TT><input type=* name=**></TT></H3>
<P><TT>*=text, password, checkbox, radio, image, hidden, submit,
reset</TT></P>
<P><TT>**=Symbolic Name for CGI script </TT></P></DL><PRE></PRE>
<P><!--################## Text & Passwd ########################--><A
name=text></A></P>
<H2><IMG height=20 alt=+ src="表单 标记.files/br20t.gif" width=20 align=top
tppabs="http://webclass/html/br20t.gif"> 文字输入和密码输入</H2>
<P><!------Text & Password-------><TT>*=text, password</TT> </P>
<H3><input type=*><BR><input type=* value=**></H3><PRE><form action=/cgi-bin/post-query method=POST>
您的姓名:
<input type=text name=姓名><br>
您的主页的网址:
<input type=text name=网址 value=http://><br>
密码:
<input type=password name=密码><br>
<input type=submit value="发送"><input type=reset value="重设">
</form>
</PRE>
<P>
<FORM action=http://cgi-bin/post-query method=post
tppabs="http://cgi-bin/post-query">您的姓名: <INPUT name=姓名><BR>您的主页的网址: <INPUT
value=http:// name=网址><BR>密码: <INPUT type=password name=密码><BR><INPUT type=submit value=发送><INPUT type=reset value=重设></FORM></P><PRE></PRE>
<P><!------Text & Password -- Size, Max -------></P>
<H3><input type=* size=**><BR><input type=* maxlength=**></H3><PRE><form action=/cgi-bin/post-query method=POST>
<input type=text name=a01 size=40><br>
<input type=text name=a02 maxlength=5><br>
<input type=submit><input type=reset>
</form>
</PRE>
<P>
<FORM action=http://cgi-bin/post-query method=post
tppabs="http://cgi-bin/post-query"><INPUT size=40 name=a01><BR><INPUT
maxLength=5 name=a02><BR><INPUT type=submit value=提交查询内容><INPUT type=reset value=重置></FORM></P><PRE></PRE>
<P><!--################## Checkbox & Radio ########################--><A
name=check></A></P>
<H2><IMG height=20 alt=+ src="表单 标记.files/br20t.gif" width=20 align=top
tppabs="http://webclass/html/br20t.gif"> 复选框(Checkbox) 和 单选框(RadioButton) </H2>
<P><!------Checkbox-------></P>
<H3><input type=checkbox><BR><input type=checkbox
checked><BR><input type=checkbox value=**></H3><PRE><form action=/cgi-bin/post-query method=POST>
<input type=checkbox name=水果1>
Banana<p>
<input type=checkbox name=水果2 checked>
Apple<p>
<input type=checkbox name=水果3 value=橘子>
Orange<p>
<input type=submit><input type=reset>
</form>
</PRE>
<P>
<FORM action=http://cgi-bin/post-query method=post
tppabs="http://cgi-bin/post-query"><INPUT type=checkbox name=水果1>Banana</P>
<P><INPUT type=checkbox CHECKED name=水果2>Apple</P>
<P><INPUT type=checkbox value=橘子 name=水果3>Orange</P>
<P><INPUT type=submit value=提交查询内容><INPUT type=reset value=重置></FORM></P><PRE></PRE>
<P><!------Checkbox-------></P>
<H3><input type=radio value=**><BR><input type=radio value=**
checked></H3><PRE><form action=/cgi-bin/post-query method=POST>
<input type=radio name=水果>
Banana<p>
<input type=radio name=水果 checked>
Apple<p>
<input type=radio name=水果 value=橘子>
Orange<p>
<input type=submit><input type=reset>
</form>
</PRE>
<P>
<FORM action=http://cgi-bin/post-query method=post
tppabs="http://cgi-bin/post-query"><INPUT type=radio name=水果>Banana</P>
<P><INPUT type=radio CHECKED name=水果>Apple</P>
<P><INPUT type=radio value=橘子 name=水果>Orange</P>
<P><INPUT type=submit value=提交查询内容><INPUT type=reset value=重置></FORM></P><PRE></PRE>
<P><!--################## Image ########################--><A
name=image></A></P>
<H2><IMG height=20 alt=+ src="表单 标记.files/br20t.gif" width=20 align=top
tppabs="http://webclass/html/br20t.gif"> 图象坐标 </H2>
<P><B>在下面选则一个系数后,在图象上点一下,就知道什么是图象坐标了!</B>
<H3><input type=image src=url></H3><PRE><form action=/cgi-bin/post-query method=POST>
<input type=image name=face src=f.gif><p>
<input type=radio name=zoom value=2 checked>x2
<input type=radio name=zoom value=4>x4
<input type=radio name=zoom value=6>x6<p>
<input type=reset>
</form>
</PRE>
<P>
<FORM action=http://cgi-bin/post-query method=post
tppabs="http://cgi-bin/post-query"><INPUT type=image height=64 width=64
src="表单 标记.files/f.gif" name=face tppabs="http://webclass/html/f.gif"></P>
<P><INPUT type=radio CHECKED value=2 name=zoom>x2 <INPUT type=radio value=4
name=zoom>x4 <INPUT type=radio value=6 name=zoom>x6</P>
<P><INPUT type=reset value=重置></FORM></P><PRE></PRE>
<P><!--################## Hidden ########################--><A
name=hide></A></P>
<H2><IMG height=20 alt=+ src="表单 标记.files/br20t.gif" width=20 align=top
tppabs="http://webclass/html/br20t.gif"> 隐藏表单的元素 </H2>
<H3><input type=hidden value=*></H3><PRE><form action=/cgi-bin/post-query method=POST>
<input type=hidden name=add value=hoge@hoge.jp>
Here is a hidden element. <p>
<input type=submit><input type=reset>
</form>
</PRE>
<P>
<FORM action=http://cgi-bin/post-query method=post
tppabs="http://cgi-bin/post-query"><INPUT type=hidden value=hoge@hoge.jp
name=add>Here is a hidden element. </P>
<P><INPUT type=submit value=提交查询内容><INPUT type=reset value=重置></FORM></P><PRE></PRE>
<P><!--################## Select ########################--><A
name=select></A></P>
<H2><IMG height=20 alt=+ src="表单 标记.files/br20t.gif" width=20 align=top
tppabs="http://webclass/html/br20t.gif"> 列表框(Selectable Menu) </H2>
<P><!------Basic-------></P>
<H3>基本语法</H3>
<DL>
<H3><select name=*><BR><option> ...<BR></select> </H3></DL>
<P><!------select & option-------></P>
<H3><option selected><BR><option value=**></H3><PRE><form action=/cgi-bin/post-query method=POST>
<select name=fruits>
<option>Banana
<option selected>Apple
<option value=My_Favorite>Orange
</select><p>
<input type=submit><input type=reset>
</form>
</PRE>
<P>
<FORM action=http://cgi-bin/post-query method=post
tppabs="http://cgi-bin/post-query"><SELECT name=fruits><OPTION>Banana<OPTION
selected>Apple<OPTION value=My_Favorite>Orange</OPTION></SELECT></P>
<P><INPUT type=submit value=提交查询内容><INPUT type=reset value=重置></FORM></P><PRE></PRE>
<P><!------size & multiple-------></P>
<H3><select size=**></H3><PRE><form action=/cgi-bin/post-query method=POST>
<select name=fruits size=3>
<option>Banana
<option selected>Apple
<option value=My_Favorite>Orange
<option>Peach
</select><p>
<input type=submit><input type=reset>
</form>
</PRE>
<P>
<FORM action=http://cgi-bin/post-query method=post
tppabs="http://cgi-bin/post-query"><SELECT size=3
name=fruits><OPTION>Banana<OPTION selected>Apple<OPTION
value=My_Favorite>Orange<OPTION>Peach</OPTION></SELECT></P>
<P><INPUT type=submit value=提交查询内容><INPUT type=reset value=重置></FORM></P><PRE></PRE>
<P><!------multiple-------></P>
<H3><select size=** multiple></H3><B>注意,是用 Ctrl 键配合鼠标实现多选。<BR>(和
MS-WINDOWS 的 File Manager 一样)</B> <PRE><form action=/cgi-bin/post-query method=POST>
<select name=fruits size=3 multiple>
<option selected>Banana
<option selected>Apple
<option value=My_Favorite>Orange
<option selected>Peach
</select><p>
<input type=submit><input type=reset>
</form>
</PRE>
<P>
<FORM action=http://cgi-bin/post-query method=post
tppabs="http://cgi-bin/post-query"><SELECT multiple size=3 name=fruits><OPTION
selected>Banana<OPTION selected>Apple<OPTION value=My_Favorite>Orange<OPTION
selected>Peach</OPTION></SELECT></P>
<P><INPUT type=submit value=提交查询内容><INPUT type=reset value=重置></FORM></P><PRE></PRE>
<P><!--################## Textarea ########################--><A
name=textarea></A></P>
<H2><IMG height=20 alt=+ src="表单 标记.files/br20t.gif" width=20 align=top
tppabs="http://webclass/html/br20t.gif"> 文本区域</H2>
<H3><textarea name=* rows=** cols=**> ... <textarea></H3><PRE><form action=/cgi-bin/post-query method=POST>
<textarea name=comment rows=5 cols=60>
</textarea>
<P>
<input type=submit><input type=reset>
</form>
</PRE>
<P>
<FORM action=http://cgi-bin/post-query method=post
tppabs="http://cgi-bin/post-query"><TEXTAREA name=comment rows=5 cols=60></TEXTAREA></P>
<P><INPUT type=submit value=提交查询内容><INPUT type=reset value=重置></FORM></P><PRE></PRE>
<P><!------Word Wrapping Off-------><A name=wrap></A></P>
<H3>对于很长的行是否进行换行的设置(Word Wrapping) <IMG height=14 src="表单 标记.files/netscape.gif"
width=80 tppabs="http://webclass/html/netscape.gif"></H3>
<H3><textarea wrap=off> ... </textarea></H3>
<DL>
<DD>不换行,是缺省设置。 </DD></DL>
<P><!------Word Wrapping Soft-------></P>
<H3><textarea wrap=soft> ... </textarea></H3>“软换行”,好象 MS-WORD
里的“软回车”。
<DL>
<DD><TT><form action=/cgi-bin/post-query method=POST><BR><textarea
wrap=soft name=comment rows=5 cols=25>
</textarea><P><BR><input type=submit><input
type=reset><BR></form></TT><BR></DD></DL>
<P>
<FORM action=http://cgi-bin/post-query method=post
tppabs="http://cgi-bin/post-query"><TEXTAREA name=comment rows=5 cols=25></TEXTAREA></P>
<P><INPUT type=submit value=提交查询内容><INPUT type=reset value=重置></FORM></P>
<P><!------Word Wrapping Hard-------></P>
<H3><textarea wrap=hard> ... </textarea></H3>“硬换行”,好象 MS-WORD
里的“硬回车”。
<DL>
<DD><TT><form action=/cgi-bin/post-query method=POST><BR><textarea
wrap=hard name=comment rows=5 cols=25>
</textarea><P><BR><input type=submit><input
type=reset><BR></form></TT><BR></DD></DL>
<P>
<FORM action=http://cgi-bin/post-query method=post
tppabs="http://cgi-bin/post-query"><TEXTAREA name=comment rows=5 wrap=hard cols=25></TEXTAREA></P>
<P><INPUT type=submit value=提交查询内容><INPUT type=reset value=重置></FORM></P><PRE></PRE><BR>
<HR>
<IMG height=58 alt="NCD HOME" hspace=3 src="表单 标记.files/angel-homeg.gif"
width=69 align=left vspace=10 border=0> <A
href="http://www.zjou.edu.cn/te/html/html.htm">(返回) HTML 语言教程:目录</A>
<BR></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -