Skip to content

netteForms.js handles empty inputs differently from server side #146

Description

@janmottl
  • my oppinion is that it is a bug
  • Nette.version = '2.4'

netteForms.js handles empty inputs differently from server side:

  • RANGE Validation of empty input is always true on server side. I suppose that validation is never executed in php.
  • RANGE Validation of empty input is always false in browser. Empty string is of course never in RANGE in js.

Example:
Following RANGE validation of empty input is always successful on server side (php) and always unsuccessful in browser (js).

       $form->addText('obrad_doba_min', '')
            ->setAttribute('class', 'obrad')
            ->addRule($form::RANGE, 'Doba tvání obřadu musí být v rozsahu %d do %d minut', [0, 59]);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions