I have a form that submits a checkbox. I would like to be able to test whether that checkbox is checked or not. I would like to do this in php upon submission of the form.
If I use $this->data('Checkbox_Name'), then I just get back the value of the checkbox, regardless of whether it is checked or not.
How can I tell whether it is checked?
The checkbox has a "ghost" value which can be configured to be different of the checkbox value itself, then you can check which value is there
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
How do I check this 'ghost' value?
in your checkbox settings > Behaviors > Data > Ghost field
you can set the value there
Also without doing that, enable the form debug and submit the form once withOUT checking the box, what value do you have in the data array under the checkbox name ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Thank you, the ghost value worked.