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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With