How to send multiple variables in jeditable?

I am completely new to jquery and now, im using jeditable to allow the user to edit some information on my web page.

So here is my problem: how do you send multiple variables to a php file using jeditable? I understand that when the user clicks the submit button, the id and value will be sent 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 x and y variables to test.php when user clicks OK button in jeditable? thanks

+6
source share
1 answer

This post is very old, but I came across it. Maybe this will help someone. A brief description would tell you the following:

"(Mixed) submitdata: Additional options when sending content. May be a hash or function that returns a hash.

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

So, in your case, you simply add an additional parameter "submitdata" as follows:

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

If the user clicks OK, the x and y values ​​will be sent to the server.

+6
source

All Articles