The “formenctype” attribute of the input element determines the encoding method for form data upon submission, applicable only for forms using the “post” method.
It’s essential to note that this attribute takes precedence over the “enctype” attribute of the <form> element.
The “formenctype” attribute is compatible with the following input types: submit and image.
Example
A form featuring two submit buttons: one sends form-data using the default encoding, while the other sends the form-data encoded as “multipart/form-data”.
<form action=”/action_page_binary.asp” method=”post”> <label for=”fname”>First name:</label> <input type=”text” id=”fname” name=”fname”><br><br> <input type=”submit” value=”Submit”> <input type=”submit” formenctype=”multipart/form-data” value=”Submit as Multipart/form-data”> </form> |