title: Fancybox script not working when there are many forms
body: <p>I have a lot of forms:</p>
  
  <pre><code>&lt;?php
      foreach ($listaMaterial as $id) {
          echo "&lt;tr&gt;&lt;td&gt;" . $id[0] . "&lt;/td&gt;
              &lt;td&gt;" . $id[1] . "&lt;/td&gt;
              &lt;td&gt;" . $id[2] . "&lt;/td&gt;
              &lt;td&gt;" . $id[3] . "&lt;/td&gt;
              &lt;td&gt;" . $id[4] ." &lt;/td&gt;
              &lt;td&gt;&lt;form method=post action=../popup.php class=rub id=rub&gt;
              &lt;input type='hidden' name='codigo' id='rub1' value=".$id[0]."&gt;
              &lt;input type='submit' value='send' class='send'&gt;&lt;/form&gt;&lt;/td&gt;
              &lt;/tr&gt;
          ";
      }
  ?&gt;
  </code></pre>
  
  <p>php code like </p>
  
  <pre><code>&lt;form method=post action=../popup.php class=rub id=rub"&gt;
  &lt;input type='hidden' name='codigo' id='rub1' value="17"&gt;
  &lt;input type='submit' value='send' class='send'&gt;&lt;/form&gt;
  
  &lt;form method=post action=../popup.php class=rub id=rub&gt;
  &lt;input type='hidden' name='codigo' id='rub1' value="18"&gt;
  &lt;input type='submit' value='send' class='send'&gt;&lt;/form&gt;
  ...
  ...
  ...
  </code></pre>
  
  <p>Upon the click of this submit I'd like the form submit data to be transferred to  Fancybox. using this code</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
   $(document).ready(function(){ 
    $(".rub").submit(function() {
  
     $form = $(this);
  
  $.ajax({
  url: $form.attr("action"),
  type: 'POST',
  data: $form.serialize(),
  success: function(data, textStatus, xhr) {
  $(".rub").fancybox({
      width       : '600',
      height      : '450',
      openEffect  : 'none',
      closeEffect : 'elastic',
      'content': data
  });
  }
  });
  
  return false;
  
  });
  });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>it is working but same window !!!!
  have to be different datas.
  and also using fancybox ajax very slow!!w!!
  Using the method suggested in the thread above, what exactly is the code?</p>