From 8e0b3c05a27f81dd3db458f8eaebf0fb648cfed9 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Wed, 5 Apr 2017 22:11:27 +0200 Subject: Strip div around checkbox field, to support contextually hiding next field. --- index.cgi | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/index.cgi b/index.cgi index 41b8f11..e437f22 100755 --- a/index.cgi +++ b/index.cgi @@ -109,21 +109,29 @@ if ($form->submitted) { template => $ack_path ); } else { - print $form->render( + printhack( $form->render( header => 1, sticky => (! $form->validate), #FIXME text => $infostring, template => $req_path - ); + )); } } elsif ($ENV{'FORMBUILDER_NOHEADER'}) { - print $form->render( + printhack( $form->render( header => 0, template => $req_path - ); + )); } else { - print $form->render( + printhack( $form->render( header => 1, template => $req_path - ); + )); +} + +# strip div around checkbox field, to support contextually hiding next field +sub printhack { + $_ = shift; + s,
,,g; + s,
\s*(?=
),,s; + print $_; } -- cgit v1.2.3