title: form submit don't call ajax function phonegap
body: <p>I'm developing a mobile app with phonegap and I have a <code>form</code> to register new users. In the broswer(chrome and firefox), the form works fine when correctly 
  filled, and show errors if something wrong.  I have an <code>alert('work!');</code> in the start of function to check if was called, in browsers the alert appears but in the app no. What can be? 
  Ps: I already have <code>&lt;access origin=""&gt;</code> to my website where's the php file of form is.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>the form:</p>
  
  <pre><code>&lt;form id="cadastro" method="post"&gt;
  
                  &lt;input type="text" style="height:30px;margin-bottom:10px;margin-top:10px;font-size:18px" name="nome" id="textinput-2" placeholder="Nome" required&gt;   
                  &lt;input type="text" style="height:30px;margin-bottom:10px;font-size:18px" name="email" id="textinput-1" placeholder="Email" required&gt;
                  &lt;div id="email_erro"&gt;&lt;/div&gt;
  
                  &lt;input type="password" style="height:30px;margin-bottom:10px;font-size:18px" name="senha" id="password" placeholder="Senha" autocomplete="off" required&gt;
                  &lt;input type="password" style="height:30px;margin-bottom:10px;font-size:18px" name="repetir_senha" id="re_password" placeholder="Repetir senha" autocomplete="off"&gt;
                  &lt;div id="senha_erro"&gt;&lt;/div&gt;
                  &lt;fieldset data-role="controlgroup" style="margin-left:5%" data-type="horizontal" data-mini="true"&gt;
                              &lt;input type="radio" name="sexo" id="radio-choice-c" value="m" checked="checked" required&gt;
                              &lt;label for="radio-choice-c"&gt;Masculino&lt;/label&gt;
                              &lt;input type="radio" name="sexo" id="radio-choice-d" value="f" required&gt;
                              &lt;label for="radio-choice-d"&gt;Feminino&lt;/label&gt;
                  &lt;/fieldset&gt;       
                  &lt;div style="margin-left:3.5%;margin-right:4%;"&gt;
                      &lt;input type="checkbox" name="newsletter" id="checkbox-mini-0" value="1" data-mini="true"&gt;
                          &lt;label for="checkbox-mini-0"&gt;Quero receber as ofertas e novidades&lt;/label&gt;
                      &lt;input type="checkbox" name="termo" id="checkbox-mini-1" data-mini="true" required&gt;
                          &lt;label for="checkbox-mini-1"&gt;Aceito os Termos de Uso e Política de privacidade&lt;/label&gt;
                      &lt;button type="submit" class="ui-btn ui-shadow ui-corner-all" id="termo" style="float:none;margin-left:2%"&gt;Criar conta&lt;/button&gt;
                  &lt;/div&gt;
              &lt;/form&gt;
  </code></pre>
  
  <p>the function:</p>
  
  <pre><code>&lt;script&gt;
          alert('entrou no script');
          $('#cadastro').submit(function(){
              var valor = $('#cadastro').serialize();
  
  
      $.ajax({
      type: 'POST',
      url: 'cadastro',
      dataType: "json",
      data: valor
  
      }).success(function(response){
          alert('retornou função');
          if (response.sucesso) { 
  
              window.localStorage["email"] = response.dados.email;
              window.localStorage["nome"] = response.dados.nome;                             
              window.localStorage["sexo"] = response.dados.sexo;                             
              window.localStorage["id"] = response.dados.id; 
              //window.localStorage["UID"] = data.uid; 
              window.location = "logado.html";
          } else {
              alert("Verifique seus dados");
  
              $('#email_erro').html(response.erro_email);
              $('#senha_erro').html(response.erro_repetir_senha);
  
              //window.location("main.html");
              }
  
      });
      return false;
      });
  
      &lt;/script&gt;
  </code></pre>