There doesn't seem to be a straightforward approach to setting both fields at the same time.<select id="birth_month" name="birthdate"> <option value=""> -- </option> <option value="01"> Jan </option> ... </select> <select id="birth_day" name="birthdate"> <option value="01"> 01 </option> ... </select>
Both of these set only a single value.$mech = Test::WWW::Mechanize->new(); ... $mech->submit_form( with_fields => { ..., 'birthdate' => ['01',0] }); # or $mech->set_fields({ ..., 'birthdate' => ['01',0] });
and the first setting is lost (overwritten by the second). I also tried HTTP::Recorder as a proxy to see what would be submitted, but it just uses the last approach (multiple calls to 'field' without apparent success). Yes, I could alter the form to avoid this, but there's a fair amount of work downstream if I do. I just want to send two values through the form under one CGI parameter, just as the real form does in the browser.$mech->field('birthdate', ['01'], 0); $mech->field('birthdate', ['17'], 1);
In reply to Duplicate field names and Test::WWW::Mechanize by Mur
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |