views:

233

answers:

2

How would I submit the value and id not to a php file like save.php (which contains codes that would save immediately the new value) but to a function?

Because I can get the whole page when I edit a certain element. Maybe because I post the value and id into a function....

A: 

can you be more explicit. Given your current text I can hjazard a guess at the answer:

If your values are part of a form (i.e. within the <form></form> tags) then they should get submitted automatically when you post the form.

Alternatively you can append them onto the end of the url: save.php?id=myid&value=myvalue

The former is more prefereable, as it is more secure because the page user cannot see what is passed.

James Wiseman
+2  A: 

I assume you mean submitting to JavaScript function. Just use a function instead of URL:

 $('.editable').editable(function(value, settings) { 
     /* Do your stuff here... */
     console.log(this);
     console.log(value);
     console.log(settings);
     return(value);
  }, { 
     type    : 'textarea',
     submit  : 'OK',
 });
Mika Tuupola