diff options
author | Jonas Smedegaard <dr@jones.dk> | 2017-04-05 22:11:27 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2017-04-05 22:11:27 +0200 |
commit | 8e0b3c05a27f81dd3db458f8eaebf0fb648cfed9 (patch) | |
tree | 31f56e8f7be47c9ba2c246ed39949035f541e4f0 | |
parent | 7c98fd91403e8217cefb80e60689d446fd7765b2 (diff) |
Strip div around checkbox field, to support contextually hiding next field.
-rwxr-xr-x | index.cgi | 20 |
1 files changed, 14 insertions, 6 deletions
@@ -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,<div class="">,,g; + s,</div>\s*(?=<div class="eye color">),,s; + print $_; } |