summaryrefslogtreecommitdiffstats
path: root/src/utils/html.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/html.c')
-rw-r--r--src/utils/html.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/utils/html.c b/src/utils/html.c
index c71d159..7dc067f 100644
--- a/src/utils/html.c
+++ b/src/utils/html.c
@@ -799,20 +799,23 @@ mq_html_form_v(const gchar *submit_name, const gchar *submit_label,
}
gchar *
-mq_html_input_text(const gchar *name, const gchar *label, const gchar *value)
+mq_html_input_text(const gchar *name, const gchar *label, const gchar *value,
+ gboolean autofocus)
{
if (label && label[0]) {
return g_strdup_printf(
"<label for=\"%s\">\n<span>%s:</span>\n"
"<input type=\"text\" name=\"%s\" id=\"%s\" "
- "value=\"%s\">\n"
+ "value=\"%s\"%s>\n"
"</label>\n",
- name, label, name, name, value ? value : "");
+ name, label, name, name, value ? value : "",
+ autofocus ? " autofocus=\"autofocus\"" : "");
} else {
return g_strdup_printf(
"<input type=\"text\" name=\"%s\" id=\"%s\" "
- "value=\"%s\">\n",
- name, name, value ? value : "");
+ "value=\"%s\"%s>\n",
+ name, name, value ? value : "",
+ autofocus ? " autofocus=\"autofocus\"" : "");
}
}