How to send multiple variables in jeditable?
Asked Answered
S

1

6

i'm quite new to jquery and right now, im using jeditable to let the user edit some information on my webpage.

So here's my problem, How do you send multiple variables to the php file using jeditable? i understand that when the user clicks the submit button, the id and value will be POST-ed to the php file.

so let's say i have this code:

var x = 1;
var y = 2;

$('.edit_area').editable('test.php', {
    type      : 'textarea', 
    cancel    : 'Cancel',
    event     : "dblclick",
    submit    : 'OK',
    indicator : '<img src="img/loading.gif">',
    tooltip   : 'Click to edit...'
});

how can i send the x and y variables to test.php when the user clicks the OK button in jeditable? thanks

Selfdeception answered 14/3, 2013 at 13:12 Comment(0)
L
6

This post is very old but I stumbled upon it. Maybe this will help somebody. A short look at the documentation would have told you this:

"(Mixed) submitdata: Extra parameters when submitting content. Can be either a hash or function returning a hash."

$(".editable").editable("http://www.example.com/save.php";, {
   submitdata : {foo: "bar"};
});

So in your case you would just add the extra parameter "submitdata" like this:

submitdata : {x: x, y: y};

If the user clicks the OK button now, the values of x and y would be posted to the server.

Lowering answered 18/7, 2013 at 21:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.