Symfony 1.4 validate form fields depending on the other fields value

If you are working with Symfony, you might need from time to time validate a field, depending on the other filed value. There are a few ways to accomplish this. One quick method is to override the bind function:

validatorSchema["secondAddress"]->setOption('required', false);

  return parent::bind($taintedValues, $taintedFiles);

So, if user is sending the first address, we don’t need the second address. Of course this is just a dummy example 🙂