[eluser]Unknown[/eluser]
Hello,
Is it possible to set validation callback on post array, that it would be called only once?
If I have:
Code:
<input type="text" name="birthday[year]" value="" />
<input type="text" name="birthday[month]" value="" />
<input type="text" name="birthday[day]" value="" />
Code:
$val->set_rules('birthday', 'Birthday', required|callback__birthday_check');
_birthday_check is called three times each time passing same array, and if I use "birthday[]" instead of "birthday" in set_rules then _birthday_check not called at all.
Please do not suggest not using arrays or doing validation for each field separately. This is just an example. If i had a big checklist, which should be validate using database, multiple callbacks would execute many SQL queries.
Thank you for your help :-)