title: best way of creating many instances of my fancybox and form
body: <pre><code>&lt;a href="#login_form" class="the_form"&gt;click to Contact&lt;/a&gt;
  </code></pre>
  
  <p>The form:</p>
  
  <pre><code>&lt;div style="display:none"&gt;
   &lt;form id="login_form" method="post" action=""&gt;
    &lt;p id="login_error"&gt;Please, enter data&lt;/p&gt;
    &lt;p&gt;
     &lt;div class="name_label"&gt;Name:&lt;/div&gt;
     &lt;input class="styled name" type="text" id="name" name="name" size="30" /&gt;
    &lt;/p&gt;
    &lt;p&gt;
     &lt;div class="email_label"&gt;eMail:&lt;/div&gt;
     &lt;input class="styled email" type="text" id="email" name="email" size="30" /&gt;
    &lt;/p&gt;
    &lt;p&gt;
     &lt;div class="note_label"&gt;Message:&lt;/div&gt;
      &lt;textarea id="msg" name="msg" class="light_box_msg"&gt;&lt;/textarea&gt;
    &lt;/p&gt;
    &lt;p&gt;
     &lt;input type="submit" value="Login" /&gt;
     &lt;input type="hidden" value="&lt;?php echo $vantage_array[$i][10]; ?&gt;" id="occupancy_contact_email"/&gt;
    &lt;/p&gt;
    &lt;p class="lightbox_close"&gt;&lt;a href="javascript:;" onclick="$.fancybox.close();"&gt;close&lt;/a&gt;&lt;/p&gt;
   &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The javascript:</p>
  
  <pre><code>$(".the_form").fancybox({
      'scrolling'     : 'no',
      'overlayOpacity': 0.1,
      'showCloseButton'   : false,
      'onClosed'      : function() {
          $("#login_error").hide();
      }
  });
  
  $("#login_form").bind("submit", function() {
  
      if ($("#name").val().length &lt; 1 || $("#email").val().length &lt; 1 || $("#msg").val().length &lt; 1)  {
          $("#login_error").show();
          $.fancybox.resize();
          return false;
      }
  });
  </code></pre>
  
  <p>This code works great one I only have one link,one form, and one <a href="http://fancybox.net/" rel="nofollow">Fancybox</a>, but I need to have multiple instances and have it properly send its values through ajax.</p>
  
  <p>What I've done is, in my database while loop, created a form for each link/entry. I guess that is where I'm messing up. </p>
  
  <p>Will I have to loop through both php and the javascript to create unique id names like </p>
  
  <pre><code>#login_form_1 and #name_1, #msg_1 etc... 
  </code></pre>
  
  <p>For each input element?</p>