[TYPO3-mvc] Re: How to validate checkboxes?

Hauke Br haukebr at gmail.com
Thu May 7 12:09:30 CEST 2015


Hi,

This has been resolved quite a while, but I've got the exact same problem and your solution doesn't seem to work.

What I've got:

model:

    /**
     * terms
     *
     * @var boolean
     * @validate Boolean(is=true)
     */
    protected $terms;

    /**
     * Returns the terms
     *
     * @return boolean $terms
     */
    public function getTerms() {
        return $this->terms;
    }

    /**
     * Sets the terms
     *
     * @param boolean $terms
     * @return void
     */
    public function setTerms($terms) {
        $this->terms = $terms;
    }

Fluid:

<f:form.checkbox name="terms" id="terms" value="terms" class="formfield-checkbox-input" />


TCA (does this have anything to do with this?):

        'terms' => array(
            'exclude' => 0,
            'label' => 'LLL:EXT:co_contact/Resources/Private/Language/locallang_db.xlf:tx_cocontact_domain_model_contact.termsLink',
            'config' => array(
                'type' => 'check',
                'readOnly' => true,
                'default' => 0
            ),
        ),




More information about the TYPO3-project-typo3v4mvc mailing list