I want to Number validation for my site, but not able to show custom validation message to user.
'CVV' => [
'label' => 'CVV Number',
'type' => 'numerical',
'numberPattern'=> '^[0-9]{3,3}$',
'min' => 100,
'minLength' => 3,
'max' => 999,
'maxLength' => 3,
'required' => true,
'integerOnly' => true,
'tooSmall' => 'CVV Number is too small (minimum is 3 characters).',
'message' => 'CVV Number is too small (minimum is 3 characters).',
'tooShort' => 'CVV Number is too small (minimum is 3 characters).',
'tooBig' => 'CVV Number is too long (maximum is 3 characters).',
'tooLong' => 'CVV Number is too long (maximum is 3 characters).',
],
I tried to set
AttributeType::Number
Also. But it didn't work. The issue: in the case of numbers like less than 3 characters, I am getting error message:
CVV Number is too small (minimum is 100).
Please Can anyone help me to get this expected message. Thank You.
rules()
method on a model?