title: jQuery e.preventDefault() not Working
body: <p>I have few lines of code to create a form and then later in the code I am using AJAX <code>$.post</code> through JSON.</p>
  
  <p>My html form scripting code creates a simple form and then by pressing a "enviar (submit) button, it'll print my vars data. I am calling with <code>$.post</code> a file called dados.php, as you'll see later in this message.</p>
  
  <p>I am in the impression that by using jQuery <code>preventDefault()</code> by clicking in the the "enviar" button nothing would happen but it'll bring to other page showing data from my vars (I am doing <code>print_r($_POST);</code> and <code>var_dump($_POST);</code> inside my dados.php.</p>
  
  <p>First, I could be wrong to thing that jQuery <code>preventDefault()</code> or others (you'll see commented in my code) "prevent" any action after the user/me click on the "enviar"(submit) button; nothing would happen, but still prints my vars data.</p>
  
  <p>Second/lastly, there's something wrong with my code.</p>
  
  <p>Please check the following scripting code for my HTML form and for my dados.php (php code); In advance I really appreciate your help:</p>
  
  <p><em><strong>MY HTML FORM/JSON:</em></strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
          &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"&gt;&lt;/script&gt;
          &lt;title&gt;&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
  
      &lt;div id="result"&gt;texto do cliente&lt;/div&gt;​
  
      &lt;form id ="myform"action="dados.php" method="post"&gt;
  
          &lt;table&gt;
              &lt;tr&gt;
                  &lt;td&gt;Nome:&lt;/td&gt;            
                  &lt;td&gt;
                      &lt;input type="text" id="first_name" value="" maxlength="25" /&gt;
                  &lt;/td&gt;            
              &lt;/tr&gt;
  
              &lt;tr&gt;
                  &lt;td&gt;Sexo:&lt;/td&gt;
                  &lt;td&gt;
                      &lt;input type="radio" id="Sexo" value="Masculino" /&gt; Masculino
                      &lt;input type="radio" id="Sexo" value="Feminino" /&gt; Feminino
                  &lt;/td&gt;
                  &lt;/tr&gt;
  
                  &lt;tr&gt;&lt;td&gt;Profissão:&lt;/td&gt;
                  &lt;td&gt;
                      &lt;select id="dropdown"&gt;
                      &lt;option value ="administrador"&gt;Administrador&lt;/option&gt;
                      &lt;option value ="analista"&gt;Analista&lt;/option&gt;
                      &lt;option value ="designer"&gt;Designer&lt;/option&gt;
                      &lt;option value ="gerente"&gt;Gerente&lt;/option&gt;
                      &lt;/select&gt;
                  &lt;/td&gt;
                  &lt;/tr&gt;
  
                  &lt;tr&gt;
                  &lt;td&gt;
                      &lt;input id="submit" type="submit" value="enviar"/&gt;                    
                  &lt;/td&gt;
                  &lt;/tr&gt;
          &lt;/table&gt;  
  
          &lt;script type="text/javascript"&gt;
              $(function(){
                  /* attach a submit handler to the form */
                  $("input[type='submit']").click(function(e) {
  
                  /* stop form from submitting normally */
                     e.preventDefault(); 
                     //e.stopImmediatePropagation();
                     //e.stopPropagation();
  
              $.post(   
                  'dados.php', {firstname: $('#first_name').val(), sexo: $('#sexo').val(),
                               profissão: $('#dropdown').val()}, function(data) {  
                  console.log(data);
                  //$('#result').html(data)
                  //$('#result').html(data.firstname)
                  //$('#result').html(data.sexo)
                  //$('#result').html(data.profissão)
                  }, 'json');
              });           
  
           &lt;/script&gt;        
  
          &lt;script&gt;
  
          &lt;/script&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><em><strong>MY DADOS.PHP:</em></strong></p>
  
  <p>
  
  <pre><code>//ECHO $_POST['dropdown'];
  
  print_r($_POST);
  
  var_dump($_POST);
  </code></pre>
  
  <p>Big Thanks.</p>
  
  <p>Marco Lanza</p>