Girdi Gönder formEnctype Özellik
Örnek
Bir sunucuya göndermeden önce form verilerinin nasıl kodlanması gerektiğini öğrenin:
var x = document.getElementById("mySubmit").formEnctype;
Tanım ve Kullanım
formEnctype özelliği, bir gönder düğmesinin formenctype özniteliğinin değerini ayarlar veya döndürür.
formenctype niteliği, form verilerinin sunucuya gönderilirken nasıl kodlanması gerektiğini belirtir (yalnızca method="post" içeren formlar için).
formenctype özelliği, <form> öğesinin enctype niteliğini geçersiz kılar.
Not: formenctype niteliği, HTML5'te type="submit" ile <input> öğesi için yenidir.
Tarayıcı Desteği
Property | |||||
---|---|---|---|---|---|
formEnctype | Yes | 10.0 | Yes | Yes | Yes |
Sözdizimi
formEnctype özelliğini döndürün:
submitObject.formEnctype
formEnctype özelliğini ayarlayın:
submitObject.formEnctype = "application/x-www-form-urlencoded,multipart/form-data,text/plain"
Mülk değerleri
Value | Description |
---|---|
application/x-www-form-urlencoded | Default. All characters are encoded before sent (spaces are converted to "+" symbols, and special characters are converted to ASCII HEX values) |
multipart/form-data | No characters are encoded. This value is required when you are using forms that have a file upload control |
text/plain | Spaces are converted to "+" symbols, but no special characters are encoded |
Teknik detaylar
Geri dönüş değeri: | Formu sunucuya göndermek için kullanılan içerik türünü temsil eden bir Dize |
---|
Daha fazla örnek
Örnek
Gönder düğmesinin formenctype özniteliğinin değerini "application/x-www-form-urlencoded" olarak değiştirin:
document.getElementById("mySubmit").formEnctype = "application/x-www-form-urlencoded";
İlgili Sayfalar
HTML referansı: HTML <input> formenctype niteliği
❮ Gönderme Nesnesini Girin