title: Symfony2 displaying countries states and cities based on the input
body: <p>I am trying to create a registration form with the Symfony2 formbuilder. This is my first time and I have a few problems. How can I display all the cities and states based on the country input? For exampel if I select UK I want to get all of the states of UK, and after the states all of the cities in that state... How is that achieved? I only found the country option in the form documentation, which displays all of the countries... But what to do with the states and cities?</p>
  
  <p>This is the form:</p>
  
  <pre><code>public function registerAction()
      {   
              $em = $this-&gt;getDoctrine()-&gt;getManager();
              $products = $em-&gt;getRepository('MpShopBundle:Product')-&gt;findAll();
  
              $form = $this-&gt;createFormBuilder()
                  -&gt;add('title', 'choice', array(
                  'choices' =&gt; array('-' =&gt; '-', 'mr' =&gt; 'Mr.', 'mrs' =&gt; 'Mrs.', 'mss' =&gt; 'Miss.')))
                  -&gt;add('firstname', 'text')
                  -&gt;add('lastname', 'text')
                  -&gt;add('Email', 'email')
                  -&gt;add('Password', 'password')
                  -&gt;add('DateOfBirth', 'date')
                  -&gt;add('Company', 'text')
                  -&gt;add('Adress', 'text')
                  -&gt;add('Country', 'country')
                  -&gt;add('State', 'locale')    
                  -&gt;add('City', 'text')
                  -&gt;add('ZipPostalCode', 'text')
                  -&gt;add('AdditionalInformation', 'textarea')
                  -&gt;add('HomePhone', 'number')
                  -&gt;add('MobilePhone', 'number')
                  -&gt;getForm()
  
                  ;
                 return $this-&gt;render('MpShopBundle:Frontend:registration.html.twig',  array(
                 'products'=&gt;$products,
                 'form'=&gt;$form-&gt;createView(),    
                 ));
  
      } 
  </code></pre>
  
  <p>What can I do>?</p>