Google Chrome: Problems with inaccurate „enctype“-data in HTML forms

Following Problem was happened to me:

I had a HTML form to send text data to the webserver. Because it was only text data, I used the enctype „text“.

<form name="formname" enctype="text" method="post" action="saveData.php">

This works in every browser like IE, Firefox and Safari. But I never tested it in the Google Chrome browser.

The form had some mandatory fields. If not all of these fields are filled, the not filled fields are colored red and the hint is shown, that all mandatory fields must be filled. Then a user called me and told me, that he is not able to register. He filled all fields and pressed the register button. Then the form was shown again, all fields were empty and all mandatory fields were colored red.

I tried it too and I do not had this problem. Then I asked, which Operating System and which browser he was using. It was Windows Vista and the Google Chrome. So I installed the Chrome on my Windows 7 and I got this error, too.

I asked myself: how can that happen, that the form transmits the data correctly in all browsers except the Google Chrome? I googled a little bit and then I got a hint, that the google WebKit, which the Chrome is using, is working really strict and in my form I wrote enctype=“text“. The correct version is enctype=“text/html“. Then it works correctly in all Browsers.

The funny thing is, that also the W3C-validator does not warn because of the incorrect enctype. So the Google Chrome is a little bit overprecise in its code interpretation, but it forces you to write correct code. May not the worst way.

Print Friendly, PDF & Email

Leave a Comment

Deine E-Mail-Adresse wird nicht veröffentlicht.