title: how to pass a hidden value using post with AJAX
body: <p>I want only registered users to vote. I do not want to change all my codes. Easiest way to do for me now is set something to true if user logged in and pass that in the hidden field. </p>
  
  <p>How can i pass a hidden value on here?</p>
  
  <p>This is what i have got so far</p>
  
  <pre><code>$(function() {
  
  $(".vote").click(function() 
  {
  
  var name = $(this).attr("name");
  var id = $(this).attr("id");
  
  var dataString = 'id='+ id ;
  var parent = $(this);
  
  
  if(name=='up')
  {
  
  $(this).fadeIn(200).html('&lt;img src="dot.gif" align="absmiddle"&gt;');
  $.ajax({
     type: "POST",
     url: "up_vote.php",
     data: dataString,
     cache: false,
  
     success: function(html)
     {
      parent.html(html);
  
    }  });
  
  }
  
  return false;
      });
  
  });
  </code></pre>
  
  <hr>
  
  <pre><code>  &lt;div class="box1"&gt;
      &lt;div class="up"&gt;&lt;a href="" class="vote" name="up" id="'.$row['id'].'"&gt;'.$row['plus'].'&lt;/a&gt;&lt;/div&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p><strong>up_vote.php</strong></p>
  
  <pre><code>if($_POST['id'])
  {
  
  $id=$_POST['id'];
  .
  .
  . 
  }
  </code></pre>