http://qs1969.pair.com?node_id=352554

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

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?