in reply to WWW::Mechanize with <SELECT> and radio button

It doesn't seem all that hard to me. It probably looks something like this:

$mech->submit_form( form_name => "CFForm_1", fields => { userStatus=>"Staff", # etc } );

In fact, there's an example in the synopsis on the WWW::Mechanize page that shows something like that. It even preserves those hidden params for you automatically. majik. What in particular didn't work?

-Paul

Replies are listed 'Best First'.
Re^2: WWW::Mechanize with <SELECT> and radio button
by Finch (Initiate) on Oct 23, 2007 at 18:48 UTC
    That's what I tried and of course I read about the module on CPAN.
    After I 'click' the button, the upcoming page shows me what options have been selected. And it always says, that no/the default option has been selected.
    Here's my code:
    $mech->submit_form( form_name => "CFForm_1", fields => {import_users => "1", userStatus => "7561", #<Select> importtype => "2", #radio button ID => "2"}, button => "add");
      The reason I suggested not filling out the hidden params is to avoid transcription errors. Unless you have a reason to change ID to 2, I'd just leave that alone and mech will carry your ID over for you.

      -Paul

        I didn't know that WWW::Mechanize takes care of hidden fields. Thanks for that hint.
        Regarding my problem:
        Editing my code made me notice that I twisted two digits in the value of the <Select>-field:
        1198 instead of 1189
        Since mech couldn't find that value I guess it just went on with the predefined ones.

        Thanks for your help,
        Finch.