Skip to main content

HTML Malformed Error on Form - Troubleshooting

Problem: The File Upload Form returns a long and cryptic malformed error and users are unable to access your form.

Exception: Malformed HTML content: <!DOCTYPE html><html><head><script>var I18n=JSON.parse

Malformed HTML Error

Solution: The malformed error happens when you use invalid HTML in your form question titles or the rich HTML fields. The fix is simple.

Open the Google Sheet, go to the File Upload Forms menu, and choose Edit Form to open the form in design mode.

Find any Rich HTML fields in the form view and click the edit button to edit the HTML field.

Rich HTML Fields

Sometime when you copy-paste rich text from Microsoft Word or another website into the question fields, some text with invalid characters and malformed HTML formatting makes it way through the form. The Google Script is unable to parse these tags and hence throws an error.

Malformed HTML

To resolve the issue, you can:

  1. Either remove the Rich HTML field that could be causing this error.
  2. Or edit the HTML field, delete the rich text and type the text manually so that no invalid formatting is added to the questions.

Save the form again and it should resolve the issue.