from、fromaction、fromenctype、autofocus属性

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>form表单</title>
</head>
<body>
      <form id="f1">
          <input type="text">
      </form>
      <textarea form="f1" autofocus="true"></textarea>
<!--通过为表单id赋值,从属某一个表单,方便添加样式-->
<!--通过autofocus控制光标的位置,自动跳转到含有该属性的输入框-->
      
      <form id="f2" action="http://localhost/MyService/formaction01.php">
          <input type="submit" name="b1" value="跳转按钮1" formmethod="get"  formaction="http://localhost/MyService/formaction01.php">打开第一个页面 
          <input type="submit" name="b2" value="跳转按钮2" formmethod="post" formaction="http://localhost/MyService/formaction02.php">打开第二个页面
          <input type="submit" name="b3" value="跳转按钮3" formmethod="post" formaction="http://localhost/MyService/formaction03.php">打开第三个页面
<!--这里用fromaction属性,可以跳转到各个其他的不同的连接,而用frommethod属性可以用来指定发送数据的方式-->
      </form>

      <from>
          <input type="text" formenctype="text/plain">
          <!--表单之中的空格被转换成加号,但不对表单中的特殊字符进行编码-->
          <input type="text" formenctype="multipart/form-data">
          <!--不对字符集进行编码,上传时必须使用该值-->
          <input type="text" formenctype="application/x-www-form-urlencoded">
          <!--发送前编码所有字符,当为get方式发送时,将编码的东西转换为字符-->
      </from>

</body>
</html>

猜你喜欢

转载自blog.csdn.net/qq_42036616/article/details/81606359