I am trying to have a form with float number validation. when validation works it won't let me click the submit button and will show the proper error message.
I am using zend framework 2 and in my Form I want to retrieve alcohol volume.
I'm trying to use the following code:
$this->add($factory->createElement(array(
'name' => 'alcohol_vol',
'attributes' => array(
'label' => 'alcohol vol%:',
'filters' => array('Float'),
'type' => 'text',
'required' => true,
),
)));
this doesn't do anything actually. it will pass validation if i enter regular text.
I also tried changing the type to 'Number' from 'text' but then it won't allow me to use floating number. it will allow only none-float numbers :)