Skip to content

netteForms: EQUAL and RANGE validations with float value fails on czech locale #1430

@janedbal

Description

@janedbal

Following code will fail on JS validation (server validation is ok). On czech locale, the visible default value in input is actually 1,1, not 1.1. There should be some JS float filtering as it is on server side.

$form->addText('float', "Float")
     ->setRequired()
     ->setDefaultValue(1.1)
     ->addRule($form::FLOAT) // filters 1,1 to 1.1 only on server side
     ->addRule($form::RANGE, "%label must be at least %d", array(1.1, NULL)); // fails 
     // also EQUAL fails

Tested on stable 2.1.1.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions