my $js = q~ function checkAll(field) { for(i=0;istart_form({-name=>'form1',-action => "/pfad/script.pl", -method=>'post'}); print $cgi->start_table({-bordercolor=>'#cccccc', -bgcolor=>'#ffffff', -border=>'0', -width=>'700'}); while ($prepare_select_hosts->fetch()){ print $cgi->Tr( $cgi->td({-width=>'20'},$id), $cgi->td($hostname), $cgi->td($ip), $cgi->td($cgi->checkbox(-name=>'host', -label=>'', -value=>"$ip")) ); } print $cgi->Tr( $cgi->td({-colspan=>'3'}, $cgi->button(-name=>'checkall', -value=>'Check All', -onMouseOver =>"this.style.color = '#FF0000'", -onMouseOut => "this.style.color = '#000000'", -onClick=>"checkAll(document.form1.host);"), $cgi->button(-name=>'uncheckall', -value=>'Uncheck All', -onMouseOver =>"this.style.color = '#FF0000'", -onMouseOut => "this.style.color = '#000000'", -onClick=>"uncheckAll(document.form1.host);"), )); print $cgi->end_table(); print $cgi->end_form(); [...]