其他分享
首页 > 其他分享> > form表单

form表单

作者:互联网

表单 form
<form action="" method="post"></form>
action=""将表单提交到对应地址
method="get/post"提交方式
get获取
post传输

1.如何实现表单提交
①<form action="提交地址"></form>
②提交按钮<button type="submit">提交</button>(button写到form里面)

表单控件
1.单行文本输入框text
<input type="text">
type类型 text 文本
2.密码password (隐藏)
<input type="password" placeholder>
3.单选按钮 radio
<input type="radio">
单选按钮实现多选一,设置同一个name值
<input type="radio" name="sex">
默认选中checked="checked"
4.多选框 复选框checkbox
<input type="checkbox">
默认选中checked="checked"
check检票 box盒子
5.上传文件 file
<input type="file" >
6.下拉框select
<select>
<option>北京市</option>
<option>河北省</option>
<option>吉林省</option>
</select>
selected下拉框默认选中
option选项
7.多行文本textarea
<textarea></textarea>


表单属性
1.提示信息placeholder
2.值 value
3.必填项required="required"
4.最大字符限制maxlength="4"
5.禁用disabled="disabled"
6.只读readonly="readonly"

标签:checked,form,表单,单选,提交,按钮,下拉框
来源: https://www.cnblogs.com/MLdetiantian/p/16103538.html