Skip to content

Reversed behaviour for the novalidate attribute in the form #274

@okoram

Description

@okoram

BC Break Report

Q A
Version 3.20.0

Summary

There is a problem with the operation of the novalidate attribute after a change:
#273

According to the documentation: https://html.spec.whatwg.org/#attr-fs-novalidate

The novalidate and formnovalidate content attributes are boolean attributes. If present, they indicate that the form is not to be validated during submission.

Therefore, it does not matter what value is assigned to the novalidate attribute. As long as this attribute is present, it is treated as TRUE - the form is not to be validated.

This change has therefore reversed the condition's behavior in all cases except one:
Element::setAttribute('novalidate', true)

In my opinion, this change should be marked as "Breaking Changes".

Previous behavior

novalidate
novalidate=""
novalidate="novalidate"
novalidate="anything"
etc. are always TRUE.

Element::setAttribute('novalidate', 'anything')
rendered as novalidate="anything", which meant TRUE

Current behavior

Element::setAttribute('novalidate', 'anything')
renders nothing, which means FALSE

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions