develooper Front page | perl.libwww | Postings from August 2001

HTML::Form checkbox question

Thread Next
steve borruso
August 24, 2001 16:14
HTML::Form checkbox question
Message ID:

I've been trying to test a group of checkboxes to see if they are checked or

Having difficulty determining the method to test the condition from reading
the Perldoc,
mailing list archive, etc.

I've been able to get the HTML page, find the form I want and test a few
things about
the checkboxes but need to know how to test if it's checked and then check
it if not.
The value() method returns the text asinged to the control. Not sure how to
test if
the control is "on/off".

Any assistance in appreciated.
Steve Borruso

    $ua = LWP::UserAgent->new;
    $r = $ua->simple_request(POST "",
                                 Userid => 'user1',
                                 password => 'pswd1',
   $html = $r->content;

   @forms = HTML::Form->parse($html,'');

   @all_input =  $forms[2] -> inputs;

   print "Content-type: text/html\n\n";

   for($i=1; $j < $#all_input + 1; $i += 1) {
      print "<br>";
      print $all_input[$i]->type;
      print "<br>";
      print $all_input[$i]->value();
      print "<br>";
      print $all_input[$i]->name();

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About