Hello!

I was programming some web automation stuff using Mech and found the following. Suppose someone not too skillful at designing HTML forms had made a form with two elements,
a checkbox and a text field, and both assigned the same name 'element_name'.

Now if I call Mech's submit_form() and specify both fields, the Mech would die with the following error:
"Illegal value 'false' for field 'element_name' at Mechanize.pm line ..."

This error originates in HTML::Form which apparently checks if the form element's type matches the element's value.

It doesn't seem right that Mech will die just because of someone specifying two fields with the same name.

For example, Mech could figure out which value belongs to which field and then submit both of them in order they appear in the form. (This is what FireFox does if a form has two fields with the same name, and then it's up to server side to decide which value to use)


Thanks,
P.Krumins

Reply via email to