Skip to content

findFormButton() is case sensitive when search for attributes #89

Description

@beckenkamp

When getFormField() tries to find form button with findFormButton() it throws ElementNotFoundException. This happens when the button have type attribute setted as "Submit" instead of "submit".

I understand that it is a stupid thing set element attributes like that example, but I gues I should report this anyway...

foreach ($xpath->query('descendant::input | descendant::button', $root) as $node) {
    if ('button' == $node->nodeName || in_array($node->getAttribute('type'), array('submit', 'button', 'image'))) {
        return $node;
    }
}

When I added "Submit" at the in_array() function, showed above, to test, it worked. Maybe we can add a strtolower() in $node->getAttribute('type') to solve this.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions