title: Symfony 2 Form: Set field required depending on checkbox not in entity
body: <p>I have a Symfony form mapped to an entity, but there are three optional values. Each of this value has a checkbox associated to it, and those checkboxes are actually not mapped to the entity.</p>
  
  <pre><code>public function buildForm(FormBuilderInterface $builder, array $options)
  {
      $builder
          -&gt;add('checkbox1', 'checkbox', array(
              'mapped' =&gt; false,
              'label_render' =&gt; false,
              'required' =&gt; false,
          ))
          -&gt;add('value1', 'text', array(
              'required' =&gt; false,
          ))
          -&gt;add('checkbox2', 'checkbox', array(
              'mapped' =&gt; false,
              'label_render' =&gt; false,
              'required' =&gt; false,
          ))
          -&gt;add('value2', 'text', array(
              'required' =&gt; false,
          ))
          -&gt;add('checkbox3', 'checkbox', array(
              'mapped' =&gt; false,
              'label_render' =&gt; false,
              'required' =&gt; false,
          ))
          -&gt;add('value3', 'text', array(
              'required' =&gt; false,
          ))
      ;
  }
  </code></pre>
  
  <p>I'd like to make the text fields required if their respective checkbox is checked. I know about validation callbacks inside the entity, but here the checkbox fields are actually not mapped, so I need something at the form level. I saw something about validation groups callbacks inside the setDefaultOptions method, but all the examples are too tightly related to actual entities. Any help?</p>