Home  >  Article  >  Web Front-end  >  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
WBOYforward
2023-09-01 19:45:06661browse

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>

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!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete