I have a form with several subforms on it. I have an isValid method for the form where I check if only one particular subform is valid. For example, I must check if subform2 validates properly. If subform validates, the whole form should be validated successfully, even if other subforms have wrong values. They just should not be validated. I tried something like this:
if($subform->isValidPartial($_POST))
return true;
}else{
return false;
}
But with no succes. This code always returns true. When the whole form is validated normally without the isValid overriden, subforms are validated properly, but thye are all validated.
isSubFormValidwill return true if at least one subform is valid. You can specify subform name or passnull.Usage example: