Dear Master Monks,

I have a form that has this on it:

<input type=image src="/images/buttons/login.gif" alt="Login">
which is the only thing to click. How can I get Mech to submit the form?

mech-dump gives:

login= (text) pass= (password) secure_login=0 (radio) [1/SSL |*0/Non-SSL] <NONAME>=<UNDEF> (image)

So far I have:

# Fields to fill out, since there is only one button, # try to let Mech find it $mech->submit_form( form_name => 'loginForm', fields => { login => $user, pass => $passwd, secure_login => '0', }, )->is_success() || die "Unable to login to $login_page, stopped"; # Ensure we've logged in successfully my $logout = $mech->find_link( text => "Logout" ); die "Did not log in, stopped" unless $logout;

Now I get the message about "Did not log in", so maybe my find_link() is incorrect?

In the click(), it says:

If there is only one button on the form, $mech->click() with no argume +nts simply clicks that one button.
So that's what I have done. Is that right?

Walking the road to enlightenment... I found a penguin and a camel on the way.....
Fancy a yourname@perl.me.uk? Just ask!!!

In reply to WWW::Mechanize - Image used as button with no name? by ghenry

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.