Formbuilder checkbox validation problem

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
pollyx
New Member
New Member
Posts: 5
Joined: Sat Oct 06, 2007 8:03 am

Formbuilder checkbox validation problem

Post 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
pollyx
New Member
New Member
Posts: 5
Joined: Sat Oct 06, 2007 8:03 am

Re: Formbuilder checkbox validation problem

Post 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
Post Reply

Return to “Modules/Add-Ons”