Form tests - Firefox bug

Back to index.

This page shows a Firefox 52 bug.

  1. Fill in less than five characters in the first min-length field below.
  2. Remove at least one character from the first max-length field below.
  3. The first field has a minlength="5" attribute, so it should switch to the invalid state and apply a red background (input:invalid {background: red}).
  4. The second field has a maxlength="5" attribute, so it should switch to the invalid state and apply a red background (input:invalid {background: red}).
  5. Both work as expected in Safari and Chrome. (Edge does not appear to support the minlength/:invalid combination.)
  6. In Firefox the fields remain in their valid state.
  7. Now try the same test in the third and fourth fields below. They turn red.
  8. The difference is that the first two fields are contained in a fieldset with fieldset:valid {content: 'string'} and fieldset:invalid {content: 'string'}. Removing both removes the bug.
The buggy field
The non-buggy field