Skip to content

form-dup-name rule should not apply to buttons in forms

The form-dup-name rule is triggered if there are two buttons in a form with the same name. e.g.,

<form method="POST" action="/actions">

  <div id="actions">
    <button name="action" value="restart-game" type="submit">Restart game</button>
    <button name="action" value="check-answer" type="submit">Check answer</button>
  </div>
</form>

This is a valid idiom for having the server perform a different action based on which button the form was submitted with and shouldn’t be flagged as an error.

PS. Thank you for making and sharing html-validate; it is excellent :) 💕

Edited by Aral Balkan