summaryrefslogtreecommitdiffstats
path: root/cgi.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-05-29 20:32:45 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-05-29 20:32:45 +0000
commit6a983151b18e81b5b04f3c5185ab00e974c51e17 (patch)
tree25b8a560137831f1e710aecd2c61093162f7b373 /cgi.c
parentd0c1ddfe7e86f4fcaa6d9e98355c6d85c96b7b46 (diff)
downloadmandoc-6a983151b18e81b5b04f3c5185ab00e974c51e17.tar.gz
Remove redundant value= attributes from option elements,
and use type=search rather than type=text for the input element because it tends to better support autocompletion. Both suggested by John Gardner <gardnerjohng at gmail dot com>.
Diffstat (limited to 'cgi.c')
-rw-r--r--cgi.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/cgi.c b/cgi.c
index f25b07f7..c1c278e3 100644
--- a/cgi.c
+++ b/cgi.c
@@ -400,7 +400,7 @@ resp_searchform(const struct req *req, enum focus focus)
/* Write query input box. */
- printf(" <input type=\"text\" name=\"query\" value=\"");
+ printf(" <input type=\"search\" name=\"query\" value=\"");
if (req->q.query != NULL)
html_print(req->q.query);
printf( "\" size=\"40\"");
@@ -436,7 +436,7 @@ resp_searchform(const struct req *req, enum focus focus)
printf(" selected=\"selected\"");
puts(">All Architectures</option>");
for (i = 0; i < arch_MAX; i++) {
- printf(" <option value=\"%s\"", arch_names[i]);
+ printf(" <option");
if (NULL != req->q.arch &&
0 == strcmp(arch_names[i], req->q.arch))
printf(" selected=\"selected\"");
@@ -449,12 +449,10 @@ resp_searchform(const struct req *req, enum focus focus)
if (req->psz > 1) {
puts(" <select name=\"manpath\">");
for (i = 0; i < (int)req->psz; i++) {
- printf(" <option ");
+ printf(" <option");
if (strcmp(req->q.manpath, req->p[i]) == 0)
- printf("selected=\"selected\" ");
- printf("value=\"");
- html_print(req->p[i]);
- printf("\">");
+ printf(" selected=\"selected\"");
+ printf(">");
html_print(req->p[i]);
puts("</option>");
}