ဖောင် enctype Property
ဥပမာ
ဆာဗာသို့မပို့မီ ဖောင်ဒေတာကို မည်သို့ကုဒ်လုပ်ရမည်ကို ပြန်ပေးပါ။
var x = document.getElementById("myForm").enctype;
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
enctype ပိုင်ဆိုင်မှုသည် ပုံစံတစ်ခုတွင် enctype attribute ၏တန်ဖိုးကို သတ်မှတ်ပေးသည် သို့မဟုတ် ပြန်ပေးသည်။
enctype attribute သည် ဆာဗာသို့မပို့မီ ဖောင်ဒေတာကို မည်သို့ကုဒ်လုပ်ရမည်ကို သတ်မှတ်ပေးသည်။
ဖောင်ဒေတာကို မူရင်းအတိုင်း "application/x-www-form-urlencoded" သို့ ကုဒ်လုပ်ထားသည်။ ဆိုလိုသည်မှာ စာလုံးအားလုံးကို ဆာဗာသို့ မပို့မီတွင် ကုဒ်နံပါတ်တပ်ထားသည် (နေရာလွတ်များကို "+" သင်္ကေတများအဖြစ် ပြောင်းလဲကာ အထူးဇာတ်ကောင်များကို ASCII HEX တန်ဖိုးများအဖြစ်သို့ ပြောင်းသွားသည်)။
Browser ပံ့ပိုးမှု
Property | |||||
---|---|---|---|---|---|
enctype | Yes | Yes | Yes | Yes | Yes |
အထားအသို
enctype ပိုင်ဆိုင်မှုကို ပြန်ပေးပါ-
formObject.enctype
enctype ပိုင်ဆိုင်မှုကို သတ်မှတ်ပါ-
formObject.enctype = "application/x-www-form-urlencoded,multipart/form-data,text/plain"
အိမ်ခြံမြေတန်ဖိုးများ
Value | Description |
---|---|
application/x-www-form-urlencoded | All characters are encoded before sent (this is default) |
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 |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | ဆာဗာသို့မပို့မီ ဖောင်ဒေတာကို မည်သို့ကုဒ်လုပ်ရမည်ကို ကိုယ်စားပြုသည့် စာကြောင်းတစ်ခု |
---|
နောက်ထပ် ဥပမာများ
ဥပမာ
ဆာဗာသို့မပို့မီ ဖောင်ဒေတာကို ကုဒ်သွင်းနည်းအတွက် enctype တန်ဖိုးကို ပြောင်းပါ-
document.getElementById("myForm").enctype = "multipart/form-data";
ဆက်စပ်စာမျက်နှာများ
HTML ရည်ညွှန်း- HTML <form> enctype attribute
❮ Form Object