Closed 4nderss closed 7 years ago
Not currently; could done by adding a "required" boolean option, then check to make sure the the element has that attribute.
Been swamped with some work code I need to get done; but I will try to get a release out on the weekend.
bolted on functionality for this.
see:
published: 0.9.22
Rolled back the config on this so its not on by default (until next minor version) ; you can add it on by setting the config:
config.requiredAttribute = [{
tag: /^button$/,
attr: /^type$/,
msg: "buttons without a type have irregular behavour"
}];
I see you have the following default rule:
I would like to configure so that this:
includes to check that there is a type tag present on each
Background: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button
Button uses "submit" as the default value for type. This causes some unexpected behavior when no type is specified and user presses enter inside a form. Browser will try and find the submit button and "click" it. If there is a button without type present the wrong button will be "clicked".
We want to avoid this by sanity checking our html for this kind of thing.
Is this possible?