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

Hello, I have a rather trivial question. I need to have my client check the box in this downloaded html form and submit it. The code for the check box looks like this:

<input name="AUPConfirmed" value="1" type="hidden"> <div id="free_aup_line" onclick="if (event.target.tagName != 'IN +PUT') document.getElementById('aupAgree').checked = !document.getElem +entById('aupAgree').checked"> <input id="aupAgree" name="aupAgree" value="1" tabindex="4" ty +pe="checkbox">

Many thanks!

Replies are listed 'Best First'.
Re: check box in a form
by Loops (Curate) on Jul 27, 2013 at 21:37 UTC
    Hi There,

    Take a look at WWW::Mechanize, it's often used in such situations. There is an instructive example given on its CPAN page.

Re: check box in a form
by Laurent_R (Canon) on Jul 27, 2013 at 22:24 UTC

    Hello, I have a rather trivial question. I need to have my client check the box in this downloaded html form and submit it. The code for the check box looks like this:

    And I have another trivial question: what is your question?

Re: check box in a form
by mtmcc (Hermit) on Jul 27, 2013 at 21:31 UTC
    What does your code for checking the box look like at the moment?

      My current code looks like this

      my $mech = WWW::Mechanize->new; $mech->get($url); $mech->follow_link( text_regex => qr/Please click here/ ); $mech->submit_form( form_number => 1, fields => { aupAgree => '1' }, );
Re: check box in a form
by Anonymous Monk on Jul 29, 2013 at 15:27 UTC
    Huh. So that's how they do the "click the checkbox label" in javascript. Only 122 characters more than wrapping the checkbox label in, you know, <label> tags.