Skip to main content
HTML Validation

To set the document’s location as the action for a form, omit the “action” attribute.

About This HTML Issue

An empty action attribute on a <form> element is not valid HTML. To submit a form to the current page URL, remove the action attribute entirely.

When a <form> has no action attribute, the browser submits the form data to the URL of the current document. This is the same behavior most developers expect from action="", but the empty string is not a valid URL according to the HTML specification. The W3C validator flags this because the action attribute, when present, must contain a valid non-empty URL.

Removing the attribute is the correct fix. The HTML living standard explicitly states that omitting action causes the form to submit to the document's own URL.

HTML examples

Invalid empty action

<form action="" method="post">
  <label for="email">Email</label>
  <input type="email" id="email" name="email">
  <button type="submit">Subscribe</button>
</form>

Fixed by removing the action attribute

<form method="post">
  <label for="email">Email</label>
  <input type="email" id="email" name="email">
  <button type="submit">Subscribe</button>
</form>

Find issues like this automatically

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

Help us improve our guides

Was this guide helpful?
🌍 Trusted by teams worldwide

Validate at scale.
Ship accessible websites, faster.

Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.

Scheduled Reports
API Access
Open Source Standards
$7 / 7 days

Pro Trial

Full Pro access. Cancel anytime.

Start Pro Trial →

Join teams across 40+ countries