zoukankan      html  css  js  c++  java
  • HTML INPUT系列使用

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
    </head>
    <body>
        <form enctype="multipart/form-data">
            <div>
                <p>请选择性别:</p>
                男:<input type="radio" name="gender" value="1" checked="checked"/>
                女:<input type="radio" name="gender" value="2"/>
                <p>爱好</p>
                篮球:<input type="checkbox" name="favor" value="1"/>
                足球:<input type="checkbox" name="favor" value="2"/>
                排球:<input type="checkbox" name="favor" value="3"/>
                皮球:<input type="checkbox" name="favor" value="4"/>
                网球:<input type="checkbox" name="favor" value="5"/>
                <p>技能</p>
                撩妹:<input type="checkbox" name="skill" />
                写代码:<input type="checkbox" name="skill"/>
                <p>上传文件</p>
                <input type="file" name="fname">
            </div>
            <input type="submit" value="提交">
            <input type="reset" value="重置">
    
        </form>
    </body>
    </html>
    View Code
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
    </head>
    <body>
        <form action="http://172.17.205.193:8888/index" method="post"><!--action提交表单。action填写url提交表单地址,method请求方式,默认是get-->
            <input type="text" name="user"/>
            <input type="text" name="email"/>
            <input type="password" name="pwd"/>
            <!-- 提交表单以字典的形式-->
            <input type="button" value="登录1"/>
            <input type="submit" value="登录2"/>
        </form>
    </body>
    </html>
    View Code
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
    </head>
    <body>
        <form action="https://www.sogou.com/web" >
            <input type="text" name="query" value="test"/>
            <input type="submit" value="搜索"/>
        </form>
    
    </body>
    </html>
    View Code

            - input系列:
                input type="text"     -name属性 value是默认值
                input type="password"    -name属性
                input type="button" -普通按钮
                input type="submit" -提交按钮 value='提交'按钮名称
                
                input type="radio" name="gender" value="1" checked="checked"  -value,name(name相同就进行互斥)。单选。checked默认被选上    
                input type="checkbox" name="favor" value="5" 复选框,value,name属性(批量获取数据)
                
                input type="file" name="fname" -上传文件依赖form表单的一个属性enctype="multipart/form-data" 表示一点一点发送服务器
                input type="reset" value="重置" -重置
               

  • 相关阅读:
    C#获取上级文件夹路径
    C#string与byte数组转行
    C#BAT与VBS文件的创建和执行调用
    C#生成条形码
    C#根据生日计算所属十二星座
    C#获取某一字符串第N到第N+1空格的字符
    WPF的DataGrid表格动态加载合并列
    WPF递归设置CheckBox与TextBox禁用联动
    WPF基础知识
    WPF Popup绑定目标控件上下左右位置
  • 原文地址:https://www.cnblogs.com/anhao-world/p/14042585.html
Copyright © 2011-2022 走看看