tadd a <label> for the options which allows to click on the label text - vote - simple cgi voting system for web and gopher
(HTM) git clone git://src.adamsgaard.dk/vote
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 3b3d8028f259aa8c06d9fda45c38de975b3df2d2
(DIR) parent b1543e65991695c6b455382a9a9b86b1bec42a6c
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sun, 4 Oct 2020 15:50:19 +0200
add a <label> for the options which allows to click on the label text
Signed-off-by: Anders Damsgaard <anders@adamsgaard.dk>
Diffstat:
M vote.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/vote.c b/vote.c
t@@ -120,11 +120,13 @@ print_poll_line(char *line, size_t *i, int intable, int vote)
puts("<table>");
}
if (vote) {
+ (*i)++;
printf("\t<tr><td class=\"choice\">");
printf("<input type=\"radio\" "
- "id=\"%ld\" name=\"choice\" value=\"%ld\" />",
- ++*i, *i);
- printf("</td><td>%s</td></tr>\n", options);
+ "id=\"o%ld\" name=\"choice\" value=\"%ld\" />",
+ *i, *i);
+ printf("</td><td><label for=\"o%ld\">%s</label></td></tr>\n",
+ *i, options);
} else
printf("\t<tr><td class=\"choice\">%ld</td><td>%s</td></tr>\n",
c, options);