HTML - attributes - accept-charset

revision:


Content

"accept-charset" attribute: character encodings for form submission. syntax some examples


"accept-charset" attribute: character encodings for form submission.

top

syntax

top

<form accept-charset="character_set">

The character_set is a space-separated list of one or more character encodings that are to be used for the form submission.
Common values are UTF-8 - character encoding for Unicode, ISO-8859-1 - character encoding for the Latin alphabet.
In theory, any character encoding can be used, but no browser understands all of them. The more widely a character encoding is used, the better the chance that a browser will understand it.


some examples

top


codes:
                    <form style="margin-left:5vw;" action="/action_page.php" accept-charset="utf-8">
                        <label for="fname">First name:</label>
                        <input type="text" id="fname" name="fname"><br><br>
                        <input type="submit" value="Submit">
                    </form>
                
First name:
Last name:
codes:
                    <form style="margin-left:5vw;"action="#" accept-charset="UTF-8">
                        First name:<input type="text" name="fname">
                        <br> 
                        Last name:<input type="text" name="lname">
                        <br>
                        <input type="submit" value="Submit">