jquery jeditable pass multiple values...

Posted by Scott on Stack Overflow See other posts from Stack Overflow or by Scott
Published on 2009-10-14T17:31:56Z Indexed on 2010/03/22 2:01 UTC
Read the original article Hit count: 554

Filed under:
|

Alright totally new to jeditable,

Say I have some <div>'s and <input type='hidden' /> items that are generated dynamically with PHP like this:

<?php while($row = $db->fetch_assoc($query)) : ?>
    <input name="hiddenID" type="hidden" value="<?php echo $row['id'] ?>"
    <div class="items"><?php echo $row['item']; ?></div>
<?php endwhile; ?>

Which gives me say...this:

1 //hidden value
item1

2 //hidden value
item2

3 //hidden value
item3

And a jeditable inline-edit script to go along with it:

  hidden = $(".items").siblings("[name=hiddenID]").val(); //using a global var..don't know how to pass it into the editable function.

  $(".items").editable('save.php', {

    type      :   'text',
    tooltip   :   'Double-Click to edit...',
    onblur    :   'submit',
    event     :   'dblclick',
    submitdata : function() {
      return {id : hidden }; //how do I pass mutiple hiddenID values??
    }
  });

I am wondering how to pass multiple values into the editable function. The way I've shown here only passes one value...the first row.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jeditable