zoukankan      html  css  js  c++  java
  • Form表单元素

    <!-- 除了按钮之外 必须写name  按钮类 必须写value --> !!
    
    action:提交给哪个网页         method:数据提交的方法   1.get  显式提交,有长度限制。   2.post  隐式提交。
    <!-- 提交给哪个页面来展现 action="页面"   method="提交方式"-->
    <form action="../aa.html" method="get" >
    <!-- 文本框 -->
    <input type="text" name="文本" value="文本框"/>
    <!-- 密码框 -->
    <input type="password" name="密码" value="密码框"/>
    <!-- 隐藏域 -->
    <input type="hidden" name="隐藏域" value="隐藏域"/>
    <!-- 文本域 用于多行文本 双标签 -->
    <textarea name="xq">文本域</textarea>
    
    <!-- 普通按钮 -->
    <input type="button" value="登录" />
    <!-- 提交按钮 -->
    <input type="submit" value="提交" />
    <!-- 重置按钮 -->
    <input type="reset" value="重置" />
    <!-- 图片 提交按钮 -->
    <input type="image" value="提交" src="插入的图片" />
    
    <!-- 单选按钮:type="radio" name值相同单选,name值不同能形成多选-->
    <input type="radio" name="sex" value="该项的值"/>1.该项的值
    <input type="radio" name="sex" value="该项的值"/>2.该项的值
    <input type="radio" name="sex" value="该项的值"/>3.该项的值
    <input type="radio" name="sex" value="该项的值"/>4.该项的值
    
    <!-- 多选按钮 复选框: type="checkbox" -->
    <input type="checkbox" name="aihao" value="1"/>1.
    <input type="checkbox" name="aihao" value="2"/>2.
    <input type="checkbox" name="aihao" value="3"/>3.
    <input type="checkbox" name="aihao" value="4"/>4.
    
    <!-- 下拉列表 -->
    <select name="shuzi">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    </select>
    
    <!-- 选取文件 文件上传 type="file" -->
    <input type="file" name="file" />
    
    <!-- 做默认选中 用作单选 多选选中 -->
    <input type="radio" name="sex" value="男" checked="checked" /><input type="radio" name="sex" value="女" /><input type="checkbox" checked="checked" name="aihao" value="玩" /><input type="checkbox" name="aihao" value="看书" />看书                 checked=checked  默认选中
    
    <!-- 在下拉列表中做默认选中 -->
    <select name="字母">
    <option value="A">A</option>
    <option selected="selected" nvalue="B">B</option>
    <option value="C">C</option>
    </select>
    </form>
    
    readonly            只读
    disabled="disabled"      不可用不能提交
    hidden="hidden"        隐藏
  • 相关阅读:
    css实现文字渐变
    mySql中Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre的问题
    mysql不等于判断时,空值过滤问题
    SpringBoot中maven打包,启动报没有主清单属性
    MySQL插入数据时报错Cause: java.sql.SQLException: #HY000的解决方法
    SpringCloud中Feign服务调用请求方式及参数总结
    linux查看占用端口号的程序及pid
    Ant Design Pro 改变默认启动端口号
    启动jar包并生成日志的linux脚本
    JavaWeb中验证码校验的功能实现
  • 原文地址:https://www.cnblogs.com/yqs0/p/6012778.html
Copyright © 2011-2022 走看看