Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
General
Wrong Validation..?
MaxG
October 2013
Hi,
When i use:
$new_task_form->add('count_bots', 'Anzahl Bots (maximal '.count(\Bots\Bots::get_all_bots(\Auth::get('owned_bots'), false)).' verfügbar)', array('class' => 'input-small'), array('required', array('numeric_max', array(count(\Bots\Bots::get_all_bots(\Auth::get('owned_bots'), false)))), array('valid_string', array('numeric'))));
-->
\Bots\Bots::get_all_bots(\Auth::get('owned_bots'), false)) is 5
And type in 3 I get the error:
The maximum numeric value of Anzahl Bots (maximal 5 verfügbar) must be 5
Could you help me?
Thanks!
:-)
Harro
October 2013
You made a typo:
$new_task_form->add('count_bots', 'Anzahl Bots (maximal
'.count(\Bots\Bots::get_all_bots(\Auth::get('owned_bots'), false)).'
verfügbar)', array('class' => 'input-small'), array('required',
array('numeric_max',
array(count(\Bots\Bots::get_all_bots(\Auth::get('owned_bots'),
false)))), array('valid_string', array('numeric'))));
should be
$new_task_form->add(
'count_bots',
'Anzahl Bots (maximal '.count(\Bots\Bots::get_all_bots(\Auth::get('owned_bots'), false)).' verfügbar)',
array('class' => 'input-small'),
array(
'required',
array('numeric_max', count(\Bots\Bots::get_all_bots(\Auth::get('owned_bots'), false))),
array('valid_string', array('numeric'))
)
);
Don't think the count should be in an array, numeric_max doesn't take multiple values.
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,089
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
261
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
Harro
October 2013