Answer the question
In order to leave comments, you need to log in
How to execute a rule only after the previous ones have been executed?
Hello. It would seem that the question is simple, the case should be frequent, but I can’t find the information for the second day ... The point is. Here is a model. It has rules. The first rule specifies that the fields are required. The second rule uses a self-written function that checks some result of the fields from the first rule. Everything works almost as it should, all the rules work at once. That is, if some fields from the upper rule are not filled in, the lower one also works and gives its own error to the error array. And this is not correct, since the lower rule will always give an error if some upper one is not filled. You need to make sure that the validator stops if there are errors in the upper rule, and does not reach the lower one.
But if all the fields are filled in and the upper rule has passed - then already give work to the lower one.
Is that possible?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question