I have a form with a checkbox that needs to be checked by visitors and I would like to display an error message via Form Template if it is left unchecked.
The form template variables field->error seem to work for normal text imput fields but not for checkbox fields. I tried to work around this problem by evaluating the checked state, but to no avail.
Is this a known bug in Formbuilder 0.4.4 or am I missing something very basic?
pollxy
pbx-manager.de
Formbuilder checkbox validation problem
Re: Formbuilder checkbox validation problem
Sorry to answer my own post, but I found a quick and dirty workaround. The error attribute value of a checkbox field returns either null or "" depending on whether it has been checked or not, so
{if $fb_form_has_validation_errors and ($mycheckbox->error === null)}
can be used to display an error message iwhen not checked.
pollyx
pbx-manager.de
{if $fb_form_has_validation_errors and ($mycheckbox->error === null)}
can be used to display an error message iwhen not checked.
pollyx
pbx-manager.de