Personally, I check with javascript before submitting the form, and then check the controller again before loading ().
My reasoning for this is that the convention is really not related to the datamodel, since it is not a stored value (and has only one valid condition, so validation does not make sense), but it is a condition for the presentation of the form. If it was a column in a table or was used to create or modify a stored value, I would probably do it on a model.
source share