contributte / live-form-validation

:no_entry: Nice client-side live form validation for Nette Forms.
https://contributte.org/packages/contributte/live-form-validation.html
BSD 3-Clause "New" or "Revised" License
59 stars 24 forks source link

Decimals #19

Closed landsman closed 8 years ago

landsman commented 8 years ago

Hi,

if i have input[type=number] and want type decimal format number, validator returning "Please enter a valid value". I am also set: "step=0.5" and without change.

Robyer commented 8 years ago

Hi, probably included code of netteForms.js must be updated (if that works in official netteForms.js). EDIT: Yes, it was fixed in official netteForms.js, I'll update this script soon.

landsman commented 8 years ago

Thanks

Robyer commented 8 years ago

Commited update, please try it and let me know if everything works as before as I didn't test it.

landsman commented 8 years ago

No change.

        $form->addText("beforeWeight", "Váha před: ")
            ->setType('number')
            ->addRule(Form::MAX_LENGTH, "Maximálně čtyř místná váha", 5)
            ->setRequired();

EDIT: this works:

        $form->addText("afterWeight", "Váha po: ")
            ->setType('number')
            ->addRule(Form::MAX_LENGTH, "Maximálně čtyř místná váha", 5)
            ->setAttribute('step', "0.1")
            ->setRequired();
Robyer commented 8 years ago

Could you check how it works in original netteForms.js? It should behave the same. So eventually you might want to create issue there,

landsman commented 8 years ago

I think that with "step" attribute it is fine.

Robyer commented 8 years ago

Ok, so I'm closing this.