HTML5: How to specify the form-data should be encoded when submitting it to the server?
Solution:
HTML Code:
Explanation:
- This HTML code demonstrates how to specify the encoding type of the form data when submitting it to the server.
- The form element is defined with method set to "post" to specify how the form data should be submitted, and action set to the URL where the form data should be sent.
- Inside the form, there is a text input field for entering the name.
- There are two submit buttons:
- The first submit button has the default form encoding.
- The second submit button overrides the default encoding by specifying multipart/form-data using the formenctype attribute.
Live Demo:
See the solution in the browser
Supported browser
Yes | Yes | Yes | Yes | Yes |
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics