Skip to content
Related Articles

Related Articles

Improve Article

How to specify the form-data should be encoded when submitting it to the server in HTML5?

  • Difficulty Level : Expert
  • Last Updated : 21 May, 2021

In this article, we will specify the form-data should encoding when submitting it to the server by using the enctype attribute in the <form> element in the HTML document. This property specifies the data that will be present in the form that should be encoded when submitting to the server. This property is used to save sensitive user data from a third party. 


<form enctype = "value">

Note: This property can be used only if the method is “POST”

Value: It accepts two value

  • application/x-www-form-urlencoded: It has the default value. It is used to convert all the characters before sent to the server. It encodes the special characters to their hex values.
  • multipart/form-data: It does not encode any plain text and special characters and only convert whitespaces into + symbols.



<!DOCTYPE html>
<body style="text-align:center">
    <h2 style="color:green">GeeksforGeeks</h2>
    <b>Form-data encoding when submitting it to the server in HTML5</b>
    <form action="#"
        First name:
        <input type="text"
        <br> Last name:
        <input type="text"
        <br>   Address:
        <input type="text"
        <input type="submit"


Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

My Personal Notes arrow_drop_up
Recommended Articles
Page :