Html from 标签

Html from 标签

<html>
<body>
    <!-- form 提交表单设置 -->
    <form>
          <input type="text" />
          <input type="password" />
          <input type="button" value="登录"/>
    </form>
    
    <!-- action="http://xxx"指向后台发送的某个位置 -->
    <form action="http://xxx">
        <!-- name="xxx" 将输入框指定key引用使用 -->
        <input type="text" name="user"/>
        <input type="password" name="passwd"/>
        <input type="submit" value="登录"/>
    </form>
    
    <!-- method="POST"修改请求形式,默认GET -->
    <form action="http://xxx" method="POST">
            <input type="text" name="user"/>
            <input type="password" name="passwd"/>
            <input type="submit" value="登录"/>
    </form>
    
    <!-- enctype="application/x-www-form-urlencoded" 表示本地上传文件一点点发给服务器 -->
    <from enctype="application/x-www-form-urlencoded">
            <!-- type="file"上传文件、name="xxx" 标识后端处理的文件名 -->
            <input type="file" name="xxx">
    </from>
</body>
</html>

效果提交表单



猜你喜欢

转载自www.cnblogs.com/xiangsikai/p/10402727.html