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: 18521
Status: resolved
Priority: 0/
Queue: WWW-Mechanize

People
Owner: Nobody in particular
Requestors: GRANTG [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.18
Fixed in: (no value)



Subject: Hidden fields don't appear in current_form if their value=""
Best way to show this is with an example: In this HTML snippet: <form name="aspnetForm" method="post" action="Browse.aspx? MyToken=632797078501515540" id="aspnetForm"> <div> <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" /> <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" /> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJ" /> </div> [...] </form> One should see three fields in a $mech->current_form->dump, but one only sees "__VIEWSTATE". And of course if one tries to do this: $mech->set_fields( '__EVENTTARGET' => 'mynewvalue' ); WWW::Mechanize dies: No such field '__EVENTTARGET' at /Library/Perl/5.8.6/WWW/Mechanize.pm line 1178 I can see why this would be coded, because why store an empty hidden field? In this case, the site uses javascript to set the field, so they include it in the form as an empty hiden field, then use JavaScript to fill in the value and do the submit (hack hack).