return g_strdup (priv->id);
}
+void
+zak_form_cgi_form_element_set_id (ZakFormCgiFormElement *element, const gchar *id)
+{
+ gchar *_id;
+
+ ZakFormCgiFormElementPrivate *priv;
+
+ g_return_if_fail (id != NULL);
+
+ _id = g_strdup (id);
+ g_strstrip (_id);
+
+ g_return_if_fail (g_strcmp0 (_id, "") != 0);
+
+ priv = ZAK_FORM_CGI_FORM_ELEMENT_GET_PRIVATE (element);
+
+ if (priv->id != NULL)
+ {
+ g_free (priv->id);
+ }
+
+ priv->id = g_strdup (_id);
+ g_hash_table_replace (priv->ht_label_attrs, "for", g_strdup (priv->id));
+
+ g_free (_id);
+}
+
/**
* zak_form_cgi_form_element_set_label:
* @element:
/*
- * Copyright (C) 2015-2017 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2015-2019 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
gchar *zak_form_cgi_form_element_get_id (ZakFormCgiFormElement *element);
+void zak_form_cgi_form_element_set_id (ZakFormCgiFormElement *element, const gchar *id);
void zak_form_cgi_form_element_set_label (ZakFormCgiFormElement *element, const gchar *label, ...);