在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提交表單資料時指定是否對其進行編碼?的詳細內容。更多資訊請關注PHP中文網其他相關文章!