views:

47

answers:

3

I use this javascript to edit text in place: http://josephscott.org/code/javascript/jquery-edit-in-place now I need to edit links as well. But when I click on link instead of just making it editable I'm redirected to the link address. How can I change it so that if double click a link just make it editable and don't redirect anywhere?

Can anyone please help?

+1  A: 

You'll need to override the default link behavior, then trigger the edit-in-place code.

$("a").click(function(){
    //whatever you have to call to make it editable
    return false; //prevent the link from being followed
});
Austin Fitzpatrick
Thanks it works fine! How should I modify the code to enter the link as before if I click it only once?
Levani
I would check out Gaby's answer at this point, he seems to know a lot more about the plugin in question.
Austin Fitzpatrick
A: 

Return false from your event handler, or with jQuery use e.preventDefault() in the handler, where e is the event object.

jasongetsdown
+3  A: 
Gaby
Still can't prevent to enter link by double click...
Levani