wilariz wrote
> luk.. now i have an error when I validate form..
> my error is :
> haystack option is mandatory
>
> trace:
> #0
> C:\xampp\htdocs\travelagency\vendor\zendframework\zendframework\library\Zend\Validator\InArray.php(175):
> Zend\Validator\InArray->getHaystack()
> #1
> C:\xampp\htdocs\travelagency\vendor\zendframework\zendframework\library\Zend\Validator\ValidatorChain.php(175):
> Zend\Validator\InArray->isValid('1', Array)
> #2
> C:\xampp\htdocs\travelagency\vendor\zendframework\zendframework\library\Zend\InputFilter\Input.php(263):
> Zend\Validator\ValidatorChain->isValid('1', Array)
> #3
> C:\xampp\htdocs\travelagency\vendor\zendframework\zendframework\library\Zend\InputFilter\BaseInputFilter.php(192):
> Zend\InputFilter\Input->isValid(Array)
> #4
> C:\xampp\htdocs\travelagency\vendor\zendframework\zendframework\library\Zend\Form\Form.php(420):
> Zend\InputFilter\BaseInputFilter->isValid()
> #5
> C:\xampp\htdocs\travelagency\module\Agencia\src\Agencia\Service\PaqueteService.php(41):
> Zend\Form\Form->isValid()
> #6
> C:\xampp\htdocs\travelagency\module\Backoffice\src\Backoffice\Controller\PaqueteController.php(97):
> Agencia\Service\PaqueteService->guardar(Array)
> #7
> C:\xampp\htdocs\travelagency\vendor\zendframework\zendframework\library\Zend\Mvc\Controller\AbstractActionController.php(87):
> Backoffice\Controller\PaqueteController->nuevoAction()
> #8 [internal function]:
> Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
> #9
> C:\xampp\htdocs\travelagency\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php(469):
> call_user_func(Array, Object(Zend\Mvc\MvcEvent))
> #10
> C:\xampp\htdocs\travelagency\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php(209):
> Zend\EventManager\EventManager->triggerListeners('dispatch',
> Object(Zend\Mvc\MvcEvent), Object(Closure))
> #11
> C:\xampp\htdocs\travelagency\vendor\zendframework\zendframework\library\Zend\Mvc\Controller\AbstractController.php(108):
> Zend\EventManager\EventManager->trigger('dispatch',
> Object(Zend\Mvc\MvcEvent), Object(Closure))
> #12
> C:\xampp\htdocs\travelagency\vendor\zendframework\zendframework\library\Zend\Mvc\DispatchListener.php(114):
> Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request),
> Object(Zend\Http\PhpEnvironment\Response))
> #13 [internal function]:
> Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
> #14
> C:\xampp\htdocs\travelagency\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php(469):
> call_user_func(Array, Object(Zend\Mvc\MvcEvent))
> #15
> C:\xampp\htdocs\travelagency\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php(209):
> Zend\EventManager\EventManager->triggerListeners('dispatch',
> Object(Zend\Mvc\MvcEvent), Object(Closure))
> #16
> C:\xampp\htdocs\travelagency\vendor\zendframework\zendframework\library\Zend\Mvc\Application.php(298):
> Zend\EventManager\EventManager->trigger('dispatch',
> Object(Zend\Mvc\MvcEvent), Object(Closure))
> #17 C:\xampp\htdocs\travelagency\public\index.php(12):
> Zend\Mvc\Application->run()
> #18 {main}
>
> how is the best way to validate a select element?
You can use "required" option and NotEmpty Validator as a simple case or
InArray Validator to do some more restrictive validation. It depends what
kind of requirements you've got and what exactly would you need to validate?
-----
Cheers,
--
Luke Mierzwa
--
View this message in context:
http://zend-framework-community.634137.n4.nabble.com/Form-element-select-error-tp4656976p4657011.html
Sent from the Zend Framework mailing list archive at Nabble.com.
--
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]