in reply to Re: W-M-F and event.keyCode===keys.ENTER
in thread W-M-F and event.keyCode===keys.ENTER

Thank you very much indeed, Corion! Managed to solve the problem along the lines you've suggested.

The situation is rather standard nowadays, with all these autofillers, etc. which makes the straight assigning of values impossible.

  • Comment on Re^2: W-M-F and event.keyCode===keys.ENTER

Replies are listed 'Best First'.
Re^3: W-M-F and event.keyCode===keys.ENTER
by Corion (Pope) on Jul 27, 2014 at 09:43 UTC

    Note that WWW::Mechanize::Firefox already sends focus and blur events if you use the ->field() method to set the value.

      Noted gratefully. I was trying to identify my input within a form, naturally, but it turned out to be difficult (the authors of the webpage seem to be a bit paranoid, anyway), that's why I was working on something else.

      Maybe a new method

      ...->set_nasty_value
      in W-M-F doing 'focus' and 'blur' on a node would be helpful on such occassions for the users of W-M-F.

        I'm not sure why ->set_nasty_value would be sp special, but I can see that adding a modification of ->field() which does take a plain DOM node instead of a field name would be convenient. The routine would reduce to

        sub set_nasty_value { my( $self, $dom_node, $value )= @_; $self->get_set_value( name => $dom_node, value => $value ) }

        ... so maybe just call it that way directly.

        I think I should document that part of ->get_set_value a bit better.