Skip to content

Prompt form validation differs between key submit and mouse submit #757

@Tilogorn

Description

@Tilogorn

I have a numerical prompt validating the input for a specific range.

bootbox.prompt({
    title: 'Your age?',
    inputType: 'number',
    min: 18,
    max: 99,
    required: true,
    callback: function(result) {
        if (result !== null) {
            console.log('Your age is ' + result);
        }
    }
});

When the prompt is submitted by the enter key, the form validation message from the browser shows up, when the value is out of range:

enter

(this is german for "Please choose a value not lower than 18")

Submitting the same input by clicking the "OK"-button just leads to a red border around the input, no message:

click

You can try it out on this codepen.

Tested in latest Firefox (screenshots) and Chrome. Is this the desired behaviour? I'd expect to see the message too when clicking the "OK" button.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions