title: How to write data option in jQuery.ajax() function when it include in a php mysql_query?
body: <p>I want to add a comment system after my article, </p>
  
  <p>php part code</p>
  
  <pre><code>&lt;?php
  ...
  while($result = mysql_fetch_array($resultset))
  {
  $article_title = $result['article_title'];
  ...
  ?&gt;
  &lt;form id="postform" class="postform"&gt;
  &lt;input type="hidden" name="title" id="title" value="&lt;?=$article_title;?&gt;" /&gt;
  &lt;input type="text" name="content" id="content" /&gt;
  &lt;input type="button" value="Submit" class="Submit" /&gt;
  &lt;/form&gt;
  ...
  &lt;?php
  }
  ?&gt;
  </code></pre>
  
  <p>ajax part:</p>
  
  <pre><code>$(function($) {
  $(document).ready(function(){
  $(".Submit").click(function(){
  var id = $(this).attr("id");
  var name = $(this).attr("name");
  var dataString = 'id='+ id ;
  var parent = $(this);
  var anyBlank = 0;
  if(anyBlank == "0")
  {
  var title    = $("#title").val();
  var content   = $("#content").val();
  $.ajax({
  type: "POST",
  url: "ajax_post.php",
  data: "title="+title+"&amp;content="+content,
  success: function(date_added){
  if(date_added != 0)
  {
  structure = '&lt;div class="comment_date_added"&gt;'+date_added+'&lt;/div&gt;&lt;div id="comment_text"&gt;&lt;div id="comment_content"&gt;'+content+'&lt;/div&gt;';                   
  $("#post_comment").prepend(structure);
  }
  });
  });
  </code></pre>
  
  <p>ajax_post.php</p>
  
  <pre><code>echo $title;
  echo $content;//get $title and $content and insert into database.
  </code></pre>
  
  <p>my question: <code>&lt;form id="postform" class="postform"&gt;</code> is written into a MYSQL_QUERY result circle.  how to modify ajax part so that every <code>div.submit</code> can post its own value to <code>ajax_post.php</code> and then return the data into <code>$("#post_comment").prepend(structure);</code> Thanks to all.</p>