Page 1 of 1

Formbuilder checkbox validation problem

Posted: Sun Oct 21, 2007 2:32 pm
by pollyx
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

Re: Formbuilder checkbox validation problem

Posted: Mon Oct 22, 2007 5:14 am
by pollyx
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