Home >Web Front-end >HTML Tutorial >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.
ExampleYou can try running the following code to implementenctype 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!