hi all,

i am using jeditable plugin to implement some feature that accept user
comment and save to the database, it is work fine for a single comment
entry, but what about if it will have a dynamic entry as following
shown.

I am not familiar much about jquery, so i want that script can change
to repeatly assign id c_1, c_2....c_N to jeditable as well as access
repeatly hidden field in the pattern shown as a parameter to pass into
php.

so when a user click "write a comment" on any comment, it will call
the save-comment.php accordingly with the parameter pass in
correctly.

jQuery(document).ready(function(){
(function($){

var x_c_1 = $('#x_c_1').val();
 $("#c_1").editable("save-comment.php?s=" + x_c_1 , {
      indicator : "<img src='templates/current-version/images/page-
loading.gif'>",
      type      : "textarea",
      submit    : "OK",
      cancel    : "Cancel",
      select    : true,
      tooltip   : ""
  });
})(jQuery);
});

<div id="c_1" >write a comment</div>
<input type='hidden' id='x_c_1' name='x_c_1' value='bababa'>

<div id="c_2" >write a comment</div>
<input type='hidden' id='x_c_2' name='x_c_2' value='bababa'>

....
<div id="c_N" >write a comment</div>
<input type='hidden' id='x_c_N' name='x_c_N' value='bababa'>


hope my question are clear and MANY THANKS for any advice/input.

thanks/Davis.


Reply via email to