I’m testing mostly the site in Google Chrome (last version), and just noticed that Opera (latest version) allows you to bypass the MANDATORY REQUIREMENT to fill the age. It simply ignores this field and even the form is successfully sent.
And also probably some old browsers still manage to curse people with IMPOSSIBLE gender values, for example.
Those. Opera in this case ignores both JS
and PHP
validation. Is it generally legal to work like PHP
and browsers?
I use the rules:
$rules[] = array( 'gender', 'required', 'message' => 'Укажите пол' ); $rules[] = array( 'birthYear', 'required', 'message' => 'Укажите год рождения' ); $rules[] = array('gender', 'in', 'range' => array("f", "m", "?"), 'message' => 'Укажите пол.');
Update
Added another rule:
$rules[] = array( 'birthYear', 'length', 'min'=>$AGE_START, 'max'=>$AGE_END, 'tooShort' => 'Укажите год рождения', 'tooLong' => 'Укажите год рождения', );
Opera is no longer buggy.