summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2017-04-05 22:11:27 +0200
committerJonas Smedegaard <dr@jones.dk>2017-04-05 22:11:27 +0200
commit8e0b3c05a27f81dd3db458f8eaebf0fb648cfed9 (patch)
tree31f56e8f7be47c9ba2c246ed39949035f541e4f0
parent7c98fd91403e8217cefb80e60689d446fd7765b2 (diff)
Strip div around checkbox field, to support contextually hiding next field.
-rwxr-xr-xindex.cgi20
1 files 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,<div class="">,,g;
+ s,</div>\s*(?=<div class="eye color">),,s;
+ print $_;
}