jjlee / mechanize

Stateful programmatic web browsing in Python, after Andy Lester's Perl module WWW::Mechanize .
http://wwwsearch.sourceforge.net/mechanize/
618 stars 123 forks source link

value for button not submitted to server #19

Closed wichert closed 14 years ago

wichert commented 14 years ago

I have a form with a couple of submit buttons which look liks this:

<button type="submit" name="action" value="publish">Publish</button> <button type="submit" name="action" value="preview">Preview</button>

When I click on one of those buttons mechanize submits the form, but does not include an action value in the request data.

Debugging this shows that this goes wrong in ScalarControl._totally_ordered_pairs() for the SubmitButtonControl instance: disabled is set to True, so no pair is returned.

wichert commented 14 years ago

.. and further debugging shows that the button actually is disabled. Normally that is not true since a javascript will always enable it, but obviously that does not happen here.