mercredi 6 février 2019

Disable multiple checkbox selection

I've got the function getValues in which I added new values. Here below the actual configuration:

public function getValues()
{
    $values = [];
    $values['D'] = 'Disabilitata';
    $values['F'] = 'Fattura NON elettronica';
    $values['FE'] = 'Fattura Elettronica';
    return $values;
}

Then I have got the function getCheckedValues(), and I want to disable multiple selection in the checkbox group. I think I should modify code here below:

public function getCheckedValues()
{
    if (is_null($this->_values))
    {
        $data = $this->getConfigData();
        if (isset($data[self::CONFIG_PATH]))
            $data = $data[self::CONFIG_PATH];
        else
            $data = '';
        $this->_values = explode(',', $data);
    }
    return $this->_values;
}

I think I should add a condition there, but I don't know exactly which one. Thanks David




Aucun commentaire:

Enregistrer un commentaire