Jeditable: additional buttons with "Ok" and "Cancel"

Is there a way to add additional buttons with click event handlers for jeditable (jQuery plugin)? I want to do this when you click on an editable element and an input element appears with the OK and Cancel buttons, I would like to add another button with text by clicking, which should redirect the user to another URL .

Can this be done? Any help is much appreciated. Thanks for the ton for your time and effort in advance.

Sincerely.

+4
source share
1 answer

I think you could use jQuery live () to add a button after creating jEditable span / input elements ...
so maybe something like this will work ...

$('.editable').live('click', function() { // Live handler called. // And here where it gets tricky with jEditable...the jQuery selector below may be all wrong $('.editable').append('<button type="submit" class="gotourl">Go to URL</button>'); }); 

and then

 $('.gotourl').live('click', function(){ // Place your redirect code here } 

tried to add another button in the send settings, and it worked fine

 submit: '<button type="submit" class="ok">OK</button> <button type="submit" class="gotourl">Go To URL</button>' 

so then when you click the Go To URL button, the live method should work ... but jEditable will work too ... so you have to debug it so that it works together ...

+4
source

All Articles