I want to validate Bank Account number(123456789)
and Routing number(434344343)
,
with custom message=>Please enter 12 digit valid account number
.(000123456789)
I used number validator, integer but not working as I expecting. Validator should checks values are numbers and also numbers length. I check this documentation here tutorial-core-validators
public function rules()
{
return [
[['accountnumber'], 'number', 'min' => 12, 'max'=>12],// not wokred
[['routingnumber'], 'number', 'min' => 9, 'max'=>9], // not wokred
// then I used
[['accountnumber', 'routingnumber', ], 'integer']
]
}
Any suggession?