- puts("<!-- Begin search form. //-->");
- printf("<DIV ID=\"mancgi\">\n"
- "<FORM ACTION=\"%s/search\" METHOD=\"get\">\n"
- "<FIELDSET>\n"
- "<LEGEND>Search Parameters</LEGEND>\n"
- "<INPUT TYPE=\"submit\" "
- " VALUE=\"Search\"> for manuals satisfying \n"
- "<INPUT TYPE=\"text\" NAME=\"expr\" VALUE=\"",
- progname);
- html_print(req->q.expr ? req->q.expr : "");
- printf("\">, section "
- "<INPUT TYPE=\"text\""
- " SIZE=\"4\" NAME=\"sec\" VALUE=\"");
- html_print(req->q.sec ? req->q.sec : "");
- printf("\">, arch "
- "<INPUT TYPE=\"text\""
- " SIZE=\"8\" NAME=\"arch\" VALUE=\"");
- html_print(req->q.arch ? req->q.arch : "");
- printf("\">");
+ printf("<form action=\"/%s\" method=\"get\" "
+ "autocomplete=\"off\" autocapitalize=\"none\">\n"
+ " <fieldset>\n"
+ " <legend>Manual Page Search Parameters</legend>\n",
+ scriptname);
+
+ /* Write query input box. */
+
+ printf(" <input type=\"search\" name=\"query\" value=\"");
+ if (req->q.query != NULL)
+ html_print(req->q.query);
+ printf( "\" size=\"40\"");
+ if (focus == FOCUS_QUERY)
+ printf(" autofocus");
+ puts(">");
+
+ /* Write submission buttons. */
+
+ printf( " <button type=\"submit\" name=\"apropos\" value=\"0\">"
+ "man</button>\n"
+ " <button type=\"submit\" name=\"apropos\" value=\"1\">"
+ "apropos</button>\n"
+ " <br/>\n");
+
+ /* Write section selector. */
+
+ puts(" <select name=\"sec\">");
+ for (i = 0; i < sec_MAX; i++) {
+ printf(" <option value=\"%s\"", sec_numbers[i]);
+ if (NULL != req->q.sec &&
+ 0 == strcmp(sec_numbers[i], req->q.sec))
+ printf(" selected=\"selected\"");
+ printf(">%s</option>\n", sec_names[i]);
+ }
+ puts(" </select>");
+
+ /* Write architecture selector. */
+
+ printf( " <select name=\"arch\">\n"
+ " <option value=\"default\"");
+ if (NULL == req->q.arch)
+ printf(" selected=\"selected\"");
+ puts(">All Architectures</option>");
+ for (i = 0; i < arch_MAX; i++) {
+ printf(" <option");
+ if (NULL != req->q.arch &&
+ 0 == strcmp(arch_names[i], req->q.arch))
+ printf(" selected=\"selected\"");
+ printf(">%s</option>\n", arch_names[i]);
+ }
+ puts(" </select>");
+
+ /* Write manpath selector. */
+