sub www_mech_deactivate { my $self = shift; my $email = shift; my $uid = $self->get_uid_from_email($email); my $path = $self->{'cfg'}->param("paths.subscription_management_page +"); $path =~ s/UID/$uid/; $self->{'agent'}->get($path); # this works to subscribe person to all lists: $self->{'agent'}->submit_form( form_number => 2, fields => { 'newsletters[65]' => '65', 'newsletters[34]' => '34', 'newsletters[17]' => '17', 'newsletters[71]' => '71', } ); # But all of these attempts fail . . . $self->{'agent'}->untick('newsletters[17]'); $self->{'agent'}->untick('newsletters[65]',''); $self->{'agent'}->untick('newsletters[34]','checked'); $self->{'agent'}->untick('newsletters[71]','71'); $self->{'agent'}->submit_form( form_number => 2 ); return; }
UPDATE:

Thanks Wind, I just tried that, and still I get the following errors:

No checkbox "newsletters[17]" for value "17" in form at /home/hesco/li +b/CMS/Drupal/SimpleNews.pm line 70 No checkbox "newsletters[34]" for value "34" in form at /home/hesco/li +b/CMS/Drupal/SimpleNews.pm line 71 No checkbox "newsletters[71]" for value "71" in form at /home/hesco/li +b/CMS/Drupal/SimpleNews.pm line 72 No checkbox "newsletters[83]" for value "83" in form at /home/hesco/li +b/CMS/Drupal/SimpleNews.pm line 73
And to give some sense of the html I'm interacting with:

<div class="form-item form-option" id="edit-newsletters-34-wrapper"> <label class="option" for="edit-newsletters-34"><input type="check +box" name="newsletters[34]" id="edit-newsletters-34" value="34" chec +ked="checked" class="form-checkbox" /> Guests</label> </div>
Can anyone please offer some additional guidance, please?

-- Hugh

if( $lal && $lol ) { $life++; }
if( $insurance->rationing() ) { $people->die(); }

In reply to How do I uncheck a checkbox with WWW::Mech? by hesco

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.