日期:2013-07-23  浏览次数:20896 次

基本语法

<------Form Basic------->

表单的基本语法

<form action="url" method=*>
...
...
<input type=submit> <input type=reset>
</form>

*=GET, POST


<------Input Basic------->

表单中提供应用户的输入方式

<input type=* name=**>

*=text, password, checkbox, radio, image, hidden, submit, reset

**=Symbolic Name for CGI script


<--################## Text & Passwd ########################-->

文字输入和密码输入

<------Text & Password------->*=text, password

<input type=*>
<input type=* value=**>

<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>

 

 

您的姓名:
您的主页的网址:
密码:
 

<------Text & Password -- Size, Max ------->

<input type=* size=**>
<input type=* maxlength=**>

<form action=/cgi-bin/post-query method=POST><input type=text name=a01 _cke_saved_name=a01 _cke_saved_name=a01 size=40><br><input type=text name=a02 maxlength=5><br><input type=submit><input type=reset></form>

 

 



 

<--################## Checkbox & Radio ########################-->

复选框(Checkbox) 和 单选框(RadioButton)

<------Checkbox------->

<input type=checkbox>
<input type=checkbox checked>
<input type=checkbox value=**>

<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>

 

 

Banana

Apple

Orange

 

 


<------Checkbox------->

<input type=radio value=**>
<input type=radio value=** checked>

<form action=/cgi-bin/post-query method=POST><input type=radio name=水果> _cke_saved_name=水果> _cke_saved_name=水果>        Banana<p><input type=radio name=水果 checked>        Apple<p><input type=radio name=水果 value=橘子>        Orange<p><input type=submit><input type=reset></form>

 

 

Banana

Apple

Orange