#!/usr/bin/perl
#
use HTML::Writer qw(xhtml1-strict.dtd);
# above @rows definition goes here.
render {
HTML {
HEAD { TITLE { "Some Form" } };
BODY {
FORM {
action_ "/cgi-bin/ff-webclient.pl";
name_ "searchForm";
id_ "searchForm";
FIELDSET {
LEGEND { 'Query finished/currently running jobs' };
DIV { class_ 'instructions' };
TABLE {
for (@rows) {
my ($label, $inputs) = @$_;
my $cs;
TR {
if ($label) {
TD {
LABEL {
class_ 'small';
for_ $inputs->[0]->{id};
$label;
};
};
}
else {
$cs = 2;
}
TD {
$cs and colspan_ $cs;
for ( @$inputs ) {
if ($_->{label}) {
t $_->{label};
BR {};
};
INPUT {
type_ $_->{type} || 'text';
name_ $_->{id};
id_ $_->{id};
$_->{value} && value_ $_->{value};
$_->{onchange} && onchange_ $_->{onchange};
$_->{onmousedown} && onmousedown_ $_->{onmousedown};
};
BR {} if @$inputs > 0
and $inputs->[-1]->{id} ne $_->{id};
}
};
};
}
};
};
};
};
};
} 1;