Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
php-coder opened this issue Sep 8, 2019 · 1 comment
Closed

Comments

@php-coder
Copy link
Contributor

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.

@rbri
Copy link
Member

rbri commented Oct 19, 2019

Sorry for being that late on this simple issue.
This is now fixed in the latest snapshot build.

@rbri rbri closed this as completed Nov 30, 2019
php-coder added a commit to php-coder/mystamps that referenced this issue Jun 26, 2020
HtmlUnit/htmlunit#75 has been fixed and we can use "novalidate" attribute
to turn off validation of a particular form.

Follow-up to #1251
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants