This is my first post to perlmonks. I have been using Perl for about 4-5 years and I need help with a script that I'm writing. I want to click a checkbox using www::mechanize. The html for the checkbox looks like this: <td><input id="chklstCC_0" type="checkbox" name="chklstCC:0" onclick="__doPostBack('chklstCC:0','')" language="javascript" /><label for="chklstCC_0">Visa</label></td> When the checkbox VISA is clicked, the javascript __doPostBack brings up more fields (newfield1,newfield2) on the htmlpage that I want to fill in as well. My script never finds newfield1 nor newfield2 because the checkbox is never getting clicked by www::mechanize. My code for checking the checkbox looks like this:
my $agent = WWW::Mechanize->new(); my $chk_visa = "chklstCC:0"; $agent->tick($chk_visa);
Is this correct?

In reply to Clicking a checkbox using www::mechanize by Anonymous Monk

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.