Skip to content

JS: failing max_length validation on checkbox list with exactly 1 item #59

Description

@PavelJurasek

Minimal code in sandbox

protected function createComponentForm()
{
    $form = new Form();
    $form->addCheckboxList('list', NULL, [
        1 => 'one',
    ])->addRule(Form::MAX_LENGTH, 'max is %d', 20);

    $form->addSubmit('submit', 'Submit');
    $form->onSuccess[] = function() {
        dump('success');
    };

    return $form;
}

val.length is undefined (val == TRUE) in netteForms.js

min_length is affected as well

Unfortunately I can't help you with js

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions