HTML <button> Formenctype Attribute
مثال
نموذج يحتوي على زري إرسال. يرسل زر الإرسال الأول بيانات النموذج بترميز الأحرف الافتراضي ، بينما يرسل الزر الثاني بيانات النموذج بدون تشفير الأحرف:
<form action="/action_page_binary.asp" method="post">
<label for="fname">First name:</label>
<input type="text" id="fname"
name="fname" value="Ståle"><br><br>
<button type="submit">Submit with character encoding</button>
<button type="submit" formenctype="text/plain">Submit without character encoding</button>
</form>
التعريف والاستخدام
تحدد السمة formenctype
كيفية تشفير بيانات النموذج قبل إرسالها إلى الخادم. تتجاوز هذه السمة سمة النموذج enctype
.
يتم formenctype
استخدام السمة فقط للأزرار ذات الامتداد
type="submit"
.
دعم المتصفح
تحدد الأرقام الواردة في الجدول إصدار المتصفح الأول الذي يدعم السمة بشكل كامل.
Attribute | |||||
---|---|---|---|---|---|
formenctype | 9.0 | 10.0 | 4.0 | 5.1 | 11.5 |
بناء الجملة
<button type="submit" formenctype="value">
قيم السمات
Value | Description |
---|---|
application/x-www-form-urlencoded | Default. All characters will be encoded before sent |
multipart/form-data | This value is necessary if the user will upload a file through the form |
text/plain | Sends data without any encoding at all. Not recommended |
❮ علامة <button> HTML