/*
- * Copyright (C) 2015 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2015-2016 Andrea Zagli <azagli@libero.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
str = g_string_new ("<div class=\"form-group");
- messages = ZAK_FORM_ELEMENT_CLASS (zak_cgi_form_element_parent_class)->get_messages (ZAK_FORM_ELEMENT (element));
+ messages = zak_form_element_get_messages (ZAK_FORM_ELEMENT (element));
if (messages != NULL)
{
g_string_append (str, " has-error");
/*
- * Copyright (C) 2015 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2015-2016 Andrea Zagli <azagli@libero.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
ZakCgiForm *form;
ZakCgiFormElement *element;
+ ZakFormElementValidator *validator;
+
zakcgimain = zak_cgi_main_new ();
str = g_string_new ("<!DOCTYPE html>\n"
zak_cgi_form_element_set_label (element, "The Label for first", NULL);
zak_form_element_add_filter (ZAK_FORM_ELEMENT (element),
ZAK_FORM_ELEMENT_FILTER (zak_form_element_filter_trim_new ()));
- zak_form_element_add_validator (ZAK_FORM_ELEMENT (element),
- ZAK_FORM_ELEMENT_VALIDATOR (zak_form_element_validator_regex_new ("^aaa$")));
+ validator = zak_form_element_validator_regex_new ();
+ zak_form_element_validator_regex_set_regex (ZAK_FORM_ELEMENT_VALIDATOR_REGEX (validator), "^aaa$");
+ zak_form_element_add_validator (ZAK_FORM_ELEMENT (element), validator);
zak_form_form_add_element (ZAK_FORM_FORM (form), ZAK_FORM_ELEMENT (element));
element = zak_cgi_form_element_check_new_attrs ("chk", NULL);