Skip to content

File input with "required" attribute never pass the validation #76

Description

@php-coder

HtmlFileInput.isValid() is always evaluate to false while I see in debugger that files_ member has a file and setFiles() has been invoked. The message is the following:

[INFO] Form validation faild; element 'HtmlFileInput[<input id="image" type="file" style="box-shadow: none; border: 0px;" accept="image/png,image/jpeg" required="required" name="uploadedImage">]' was not valid. Submit cancelled.

So, either the change event doesn't set value attribute or HtmlFileInput should override isValid() method and look on files_ content.

Seen on htmlunit 2.36.0 and it worked to me on 2.21

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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