Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the WWW-Mechanize CPAN distribution.

Report information
The Basics
Id: 2308
Status: resolved
Priority: 50/
Queue: WWW-Mechanize

People
Owner: Nobody in particular
Requestors: nadine.and.henry [...] pobox.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.38
Fixed in: (no value)



Subject: forms with multiple submit buttons
In order to click on a button in a form that has more than one button named submit I had to resort to: my $form = $agent->current_form; my $update = $form->find_input('submit','submit',1); my $request = $update->click($form); $agent->{req} = $request; -----------^^^ $agent->_do_request; I feel particular guilty about stuffing a request object into $agent->{req} I would be nice if you modifed the req method to allow me to set the field, as well as just read it. Thanks. Best wishes, Henry Laxen
From: mark [...] summersault.com
[guest - Sun Mar 30 15:37:01 2003]: Show quoted text
> In order to click on a button in a form that has more than one button > named submit I had to resort to: [...snip...]
Recommend closing as dupe of Bug #2326.
[guest - Sun Mar 30 15:37:01 2003]: Show quoted text
> In order to click on a button in a form that has more than one button > named submit I had to resort to: > > my $form = $agent->current_form; > my $update = $form->find_input('submit','submit',1); > my $request = $update->click($form); > $agent->{req} = $request; > -----------^^^ > $agent->_do_request; > > I feel particular guilty about stuffing a request object into $agent-
> >{req}
> I would be nice if you modifed the req method to allow me to set the > field, as well as just read it. > Thanks. > Best wishes, > Henry Laxen
On version 1.02 the code fails. It appears _do_request is deprecated. The code below worked for me. my $form = $agent->form_number(1); #_number or _name my $field = $form->find_input('action','submit',1); #Find the first action button my $request = $field->click($form); #Generate the request my $response = $mech->request($request); #and send it
From: mark [...] summersault.com
Show quoted text
> On version 1.02 the code fails. It appears _do_request is deprecated. > The code below worked for me. > > my $form = $agent->form_number(1); #_number or _name > my $field = $form->find_input('action','submit',1); #Find the first > action button > my $request = $field->click($form); #Generate the request > my $response = $mech->request($request); #and send it
This is a working solution, so this bug can be closed.