Trying to get my head around some slightly more complex custom CakePHP validation rules.
I have Posts
that have to be associated with a City
Some (larger) cities have SubCities
. My Posts
table has both city_id
and sub_city_id
, so in some cases, sub_city_id
will be Null.
I have a nice ajax form working that loads and lets you select a SubCity
if you've first selected a City
that has some. I would like to write a validation rule so you can't have a sub_city_id
of Null if SubCities
are available on the city_id
field.
Any help on the best way to go about this?