إدخال إرسال النموذج ، نوع الخاصية
مثال
اكتشف كيف يجب تشفير بيانات النموذج قبل إرسالها إلى الخادم:
var x = document.getElementById("mySubmit").formEnctype;
التعريف والاستخدام
تقوم الخاصية formEnctype بتعيين أو إرجاع قيمة سمة formenctype لزر إرسال.
تحدد سمة formenctype كيفية تشفير بيانات النموذج عند إرسالها إلى الخادم (فقط للنماذج ذات الأسلوب = "post").
تتجاوز سمة formenctype سمة enctype لعنصر <form>.
ملاحظة: سمة formenctype جديدة لعنصر <input> مع type = "submit" في HTML5.
دعم المتصفح
Property | |||||
---|---|---|---|---|---|
formEnctype | Yes | 10.0 | Yes | Yes | Yes |
بناء الجملة
قم بإرجاع خاصية FormEnctype:
submitObject.formEnctype
قم بتعيين خاصية formEnctype:
submitObject.formEnctype = "application/x-www-form-urlencoded,multipart/form-data,text/plain"
قيم الملكية
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 |
تفاصيل تقنية
قيمة الإرجاع: | سلسلة ، تمثل نوع المحتوى الذي يتم استخدامه لإرسال النموذج إلى الخادم |
---|
مزيد من الأمثلة
مثال
غيّر قيمة سمة formenctype لزر إرسال إلى "application / x-www-form-urlencoded":
document.getElementById("mySubmit").formEnctype = "application/x-www-form-urlencoded";
الصفحات ذات الصلة
مرجع HTML: سمة تنسيق HTML <input>
❮ إدخال كائن إرسال