Skip to main content
HTML Validation

Bad value “” for attribute “name” on element “form”: Must not be empty.

About This HTML Issue

An empty value for the name attribute on the form element is invalid and should be removed or replaced with a valid non-empty string.

The name attribute on a form element provides a way to reference forms via scripts and images, and it must not be empty. According to the HTML standard, if the name attribute is present, it must have a non-empty value. An empty string is considered invalid and will trigger HTML validator errors.

Invalid example:

<form name="">
<!-- form elements here -->

</form>

How to fix:

  • Remove the empty name attribute if you don’t need it.
  • Replace the empty value with a meaningful, unique name if you require it for scripting or identification.

Valid examples:

<form>
<!-- form elements here -->

</form>
<form name="registrationForm">
<!-- form elements here -->

</form>

Avoid using empty attribute values, as they do not provide any benefit and result in validation errors.

Last reviewed: May 19, 2025

Was this guide helpful?

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Ready to validate your sites?
Start your free trial today.