title: jquery <a> tag click event
body: <p>I am building a code which displays user information on search. User information, is then displayed in a <code>fieldset</code>, and a image, first name, last name and few profile info. is shown, and in the bottom of the <code>fieldset</code>, there's  a add as friend hyperlink:</p>
  
  <pre><code>&lt;a href="#" id="aaf"&gt;add as friend&lt;/a&gt;
  </code></pre>
  
  <p>Now I want to use jquery <code>$post()</code> method to interact with another page. I also have a hidden field inside that user <code>fieldset</code> which has the user id value. Now, when i create a click functionality using <code>jquery</code>, i am not able to access the different hidden field values. Now i want to know how to achieve this functionality? For checking if i can get the value of hidden fields inside a set of code, i did this.</p>
  
  <pre><code>$(document).ready(function () {
      $("a#aaf").bind('click', function () {
          alert($("#uid").val());
      });
  });
  </code></pre>
  
  <p>But I'm only getting the value of first <code>fieldset</code>, not others. Kindly guide me in this.</p>
  
  <p>Thanks in advance.</p>
  
  <p>EDIT: How to get it in each tag click event? I'm putting some more code here,</p>
  
  <pre><code>&lt;?php foreach($query-&gt;result() as $row){?&gt;
  &lt;fieldset&gt;
      &lt;legend&gt;
          &lt;?php echo $row-&gt;firstname.' '.$row-&gt;lastname;?&gt;
      &lt;/legend&gt;
      &lt;img src='&lt;?php echo $row-&gt;profile_img_url;?&gt;'/&gt;&lt;br&gt;
      &lt;a href="#" id="aaf"&gt;add as friend&lt;/a&gt;
      &lt;input name="uid" type="hidden" value='&lt;?php echo $row-&gt;uid;?&gt;' id="uid"&gt;
  &lt;/fieldset&gt;
  </code></pre>