Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom classes #8

Open
cbichis opened this issue Aug 15, 2017 · 0 comments
Open

Custom classes #8

cbichis opened this issue Aug 15, 2017 · 0 comments

Comments

@cbichis
Copy link

cbichis commented Aug 15, 2017

Hi,

One issue I noticed with the library is I cant add also some custom css classes directly when adding the form element.

    $this->addElement('text', 'date', array(
        'attribs' => [
            'onchange' => 'this.form.submit()',
            'class' => 'datepicker',
            'size' => 10,
            'maxlength' => 10,
        ],
        'value' => date('Y-m-d')
    ));

The class is overwrited by form-control.

I can append additional classes only after the form element is added.

    $class = $this->getElement('date')->getAttrib('class');
    $this->getElement('date')->setAttrib('class', $class.' datepicker');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant