# Table data my @rows = ( ['FaultFinder ID', [{ id => 'ff-job-id' }] ], ['Username', [{ id => 'searchby-user'}] ], ['Status', [{ id => 'searchby-status'}] ], ['Time', [ { id => 'searchby-date-start', label => 'begin', onchange => 'checkDate(this)', }, { id => 'searchby_date_end', label => 'end', onchange => 'checkDate(this)', }, ] ], ['', [ { id => 'right_submit_button', type => 'submit', onmousedown => "checkForm('searchForm')", value => 'Go', }, { id => 'submitted', type => 'hidden', value => 'get_existing_ff', }, ] ] ); #### #!/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;