日期:2014-05-17 浏览次数:20827 次
<form action ="表单提交地址" method ="提交方法" name ="MyForm"> <!--文本框、按钮等表单元素--> </form>
<!--表单元素的基本格式--> <input name ="元素格式" type ="类型" value ="值" size ="显示宽度" maxlength ="字符长度" checked ="是否选中" />
<!--文本输入框--> <input type ="text" name ="username" size ="20" /> <!--密码输入框--> <input type ="password" name ="pwd" size ="20" /> <!--单选框--> <p>性别: <input type ="radio" name ="sex" value ="女" />女 <input type ="radio" name ="sex" value ="男" checked ="checked"/>男 </p> <!--复选框--> <p>课程选择: <input type ="checkbox" name ="cb1" value ="C++" />C++ <input type ="checkbox" name ="cb2" value ="java" />java <input type ="checkbox" name ="cb3" value ="C#" />C# <input type ="checkbox" name ="cb4" value ="php" />php </p> <!--提交按钮/重置按钮/普通按钮--> <input type ="submit" name ="submit1" value ="提交" /> <input type ="reset" name ="reset1" value ="重置" /> <input type ="button" name ="button1" value ="取消" /> <!--下拉列表--> <select name ="列表名称"> <option value ="值">text</option> </select> <!--多行文本域 cols:文本区内的可见宽度 rows:文本区内的可见高度--> <textarea name ="content" cols ="x" rows ="y"> text </textarea>