On Jan 23, 2008, at 11:50 PM, frizzle wrote:
Hi there,
Imagine i have a DIV with editable content (with Jeditable), but i
want the trigger for that to be a link behind the div.
It´s probably very simple, but i´m pretty new to jQuery and do not
know how to achieve this.
It has to look somewhat like this;
<div class="edit" id="unique_id">Editable text</div> <a
href="#">Edit me!!</a>
If your html is:
-cut-
<div class="edit" id="unique_id">Editable text</div> <a href="#"
class="edit_trigger">Edit me!!</a>
-cut-
You could do something like:
-cut-
$(".edit").editable("<?php print $url ?>echo.php", {
event : "edit"
});
$(".edit_trigger").bind("click", function() {
$(this).prev().trigger("edit");
});
-cut-
Hope this helps.
--
Mika Tuupola
http://www.appelsiini.net/