Skip to content

Field is always required even when "novalidate" attribute is specified #75

@php-coder

Description

@php-coder

I have a form where one of the fields has "required" attribute. htmlunit 2.36.0 respects this and doesn't allow me to submit a form with an empty field.

In order to validate a server side validation, I added a "novalidate" attribute to a form and I expect that htmlunit will ignore client side validation and let me submit a form with an empty required field. But htmlunit still doesn't submit a form and complains that form validation failed:

[INFO] Form validation faild; element 'HtmlTextInput[<input id="name" type="text" class="form-control" required="required" name="name" value="">]' was not valid. Submit cancelled.

It seems like a bug as I believe that htmlunit should skip "required" field validation when "novalidate" is present on a form.

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