प्रपत्र enctype संपत्ति
उदाहरण
सर्वर पर भेजने से पहले फॉर्म-डेटा को कैसे एन्कोड किया जाना चाहिए, इस पर वापस लौटें:
var x = document.getElementById("myForm").enctype;
परिभाषा और उपयोग
enctype गुण किसी प्रपत्र में enctype विशेषता का मान सेट या लौटाता है।
enctype विशेषता निर्दिष्ट करती है कि सर्वर पर भेजने से पहले फॉर्म-डेटा को कैसे एन्कोड किया जाना चाहिए।
प्रपत्र-डेटा डिफ़ॉल्ट रूप से "एप्लिकेशन/x-www-form-urlencoded" में एन्कोड किया गया है। इसका मतलब है कि सर्वर पर भेजे जाने से पहले सभी वर्णों को एन्कोड किया गया है (रिक्त स्थान "+" प्रतीकों में परिवर्तित हो जाते हैं, और विशेष वर्ण ASCII HEX मानों में परिवर्तित हो जाते हैं)।
ब्राउज़र समर्थन
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 विशेषता
प्रपत्र वस्तु