如何在使用HTML提交表单数据时指定是否对其进行编码?

原创
ithorizon 5个月前 (10-19) 阅读数 38 #HTML

在HTML中使用enctype 属性来设置在提交到服务器时是否对表单数据进行编码。

示例

您可以尝试运行以下代码来实现enctype 属性 −

<!DOCTYPE html>
<html>
   <body>
      <p>Which sports do you like?</p>
      <form action = "" method = "post" enctype = "multipart/form-data">
         <input type = "checkbox" name = "vehicle" value = "football" checked> Football<br>
         <input type = "checkbox" name = "vehicle" value = "cricket" checked> Cricket<br>
         <input type = "checkbox" name = "vehicle" value = "hockey"> Hockey<br>
         <input type = "submit" value = "Submit">
      </form>
   </body>
</html>

以上就是如何在使用HTML提交表单数据时指定是否对其进行编码?的详细内容,更多请关注IT视界其它相关文章!



热门