Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-25 14:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found