Home > Web Front-end > HTML Tutorial > How do I specify whether to encode form data when submitting it using HTML?

How do I specify whether to encode form data when submitting it using HTML?

WBOY
Release: 2023-09-01 19:45:06
forward
741 people have browsed it

How do I specify whether to encode form data when submitting it using HTML?

Use the enctype attribute in HTML to set whether form data is encoded when submitted to the server.

Example

You can try running the following code to implement

enctype property −

<!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>
Copy after login

The above is the detailed content of How do I specify whether to encode form data when submitting it using HTML?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template