Condition rule Form::FLOAT
Notice: This thread is very old.
- h4kuna
- Backer | 740
Hi
I found different behavior if i use rule FLOAT.
Use case:
If I write to input 5,5 that ok change to 5.5. If I uncomment condition
I get 5,5 instead of 5.5.
Example:
<?php
public function createComponentForm() {
$form = new Form;
$form->addText('float', 'čislo')
//->addCondition(Form::FILLED)
->addRule(Form::FLOAT, 'Je potřeba vyplnit číslo');
$form->addSubmit('send', 'Uložit');
$form->onSuccess[] = callback($this, 'processForm');
return $form;
}
public function processForm($form) {
$val = $form->getValues();
dump($val['float']);
}
?>
Nette: 2.0.12
PHP: 5.3.10