aboutsummaryrefslogtreecommitdiff
path: root/src/form.cc
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2012-11-25 02:23:37 +0000
committercorvid <corvid@lavabit.com>2012-11-25 02:23:37 +0000
commitea6ae568badbabb1441a4317e4f9e54ea98cc8b6 (patch)
tree21061b1eb3f6fc3a864fb40d9cd8ff76924a9f1d /src/form.cc
parent975fc68c4d5bd9ce6ca2e536f4c8a3c6d59962b9 (diff)
and now we can implement maxlength
Diffstat (limited to 'src/form.cc')
-rw-r--r--src/form.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/form.cc b/src/form.cc
index b495e7b4..b128c411 100644
--- a/src/form.cc
+++ b/src/form.cc
@@ -548,10 +548,11 @@ void Html_tag_open_input(DilloHtml *html, const char *tag, int tagsize)
if (a_Html_get_attr(html, tag, tagsize, "readonly"))
((EntryResource *) resource)->setEditable(false);
-// /* Maximum length of the text in the entry */
-// if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "maxlength")))
-// gtk_entry_set_max_length(GTK_ENTRY(widget),
-// strtol(attrbuf, NULL, 10));
+ /* Maximum length of the text in the entry */
+ if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "maxlength"))) {
+ int maxlen = strtol(attrbuf, NULL, 10);
+ ((EntryResource *) resource)->setMaxLength(maxlen);
+ }
}
if (prefs.show_tooltip &&
(attrbuf = a_Html_get_attr(html, tag, tagsize, "title"))) {