libwww-perl / WWW-Mechanize

Handy web browsing in a Perl object
https://metacpan.org/pod/WWW::Mechanize
Other
68 stars 53 forks source link

WM: submit_form( with_fields => { submit => 'some value' } ) won't POST the "submit" parameter #151

Open spazm opened 7 years ago

spazm commented 7 years ago

ddascale...@gmail.com reported on Aug 14, 2009

What steps will reproduce the problem?
1. Have a form with two submit elements named 'submit' but having different
values (example:
http://github.com/marcusramberg/mojomojo/blob/9bfd143fa0247a5cc15b626d58eda65c183c10a2/root/base/page/edit.tt#L58)
2. Run this code:

$mech->submit_form(
    submit => 'Save and View',
    with_fields => {
        body => '...'
    }
)

What is the expected output? What do you see instead?

The 'submit' field is not posted. A functional workaround that posts the
'submit' field is:

$mech->form_with_fields('body');
$mech->field(body => '...')
ok $mech->click_button(value => 'Save and View');

What version of the product are you using? On what operating system?

WWW::Mechanize 1.58 on Windows XP SP3.

Details

Imported from Google Code issue 115 via archive

Comments

ddascale...@gmail.com commented on Aug 15, 2009 :

Attached test case showing failure on *nix (hangs on Windows - see issue #116).

krawczyk commented on Mar 11, 2010 :

This is a bug in LWP, not in Mechanize.  I have submitted a patch to have it fixed:

https://rt.cpan.org/Public/Bug/Display.html?id=55480

petda...@gmail.com commented on Apr 10, 2010 :

(No comment was entered for this change.)

petda...@gmail.com commented on Apr 12, 2010 :

(No comment was entered for this change.)