In html, the use of enctype attribute is to indicate how form data should be encoded before it being sent to the location defined by action attribute. By default, a form data which contains spaces are converted to “+” symbols, and special characters such as apostrophes, percentage and other symbols are converted to their relevant ASCII codes.
The default value of enctype attribute is “application/x-www-form-urlencoded“(it does need to be set explicitly).It make sure that all form data characters are encoded before they are sent to the server.
Other possible values of enctype attribute are “multipart/form-data” which is suitable when using a file upload form(where no character encoding takes place but transfers form data as a compound MIME document) and “text/plain” which converts spaces to “+” symbols but other special symbols like apostrophes remain in their original format.
<form action="address.php" method="get" enctype="text/plain"> <div> <label for="txtname">Full Name:</label> <input type="text" name="txtname" id="txtname"/> </div> <div> <label for="txtcontacttel">Contact Tel:</label> <input type="text" name="txtcontacttel" id="txtcontacttel"/> </div> <div> <input type="submit" name="cmdSubmit" id="cmdSubmit" value="Send personal details"/> </div> </form>
There are no compatibility issues with popular browsers like IE, Firefox, Safari, Opera and Chrome. They provides excellent support to function successfully.