Skip to content

[Bug] Native checkbox validation fails #105

@stebogit

Description

@stebogit

Version

1.3

Reproduction link

https://jsfiddle.net/jStefano/j23nvhy0

Operating System

MAC OS

Device

MacBook

Browser & Version

Chrome/Firefox

Steps to reproduce

input a username and don't check the checkbox, then hit submit

What is expected?

the browser form validation should display a warning prompting the user to check the terms and conditions checkbox

What is actually happening?

the warning is not shown, in fact nothing happens, and in Chrome an error is logged to the console


Solution

remove visibility: hidden from the input style and move it a bit so that the warning message can appear in the expected position.

.form-check input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    visibility: initial !important;
    left: 27px;
    top: 8px;
}

Additional comments

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions