chinaka
(chinaka)
1
Hello guys,
I want to set a maximum number of characters for this field to 11.
Here is my rule:
[[‘field’], ‘number’, ‘max’ => ‘11’],
But even when the field is less than 11 i still get the error:
field must be no greater than 11.
Please what am i doing wrong.
samdark
(Alexander Makarov)
2
Please provide more details:
- Some code for the model/form.
- Do you use AJAX validation or clientside validation?
Thoulah
(Mr.42)
3
You’re now validating a number, not the amount of characters.
Don’t you need [['field'], 'string', 'length' => [1, 11]],
or [['field'], 'string', 'max' => 11],
?