I noticed that if the trigger is in a different TD than the DIV
itself, Mika's method won't work, am i correct?

On Jan 24, 1:58 pm, frizzle <[EMAIL PROTECTED]> wrote:
> On Jan 24, 12:39 pm, frizzle <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Jan 24, 11:59 am, Mika Tuupola <[EMAIL PROTECTED]> wrote:
>
> > > 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 Tuupolahttp://www.appelsiini.net/
>
> > Thank you both for your answers. I don't have time to test it yet, but
> > i'm eager to try them!
> > The way i see it now, i'll need Javier's code, if i'm right Mika's
> > code would still require the actual editable item to be a trigger.
>
> > Thanks again, i'll let you guys know what i did.
>
> > Frizzle.
>
> While i'm at it: i've also been unable sofar to find an explanation of
> how to add validation to jeditable:
> i want to use Jeditable to edit filenames in a dirlist. So when i've
> editted one, i need to check with the server wether or not the
> filename is allowed, and if it's unique.
> At best i will be able to trigger an alert kind of thing with the
> result coming from the server...
>
> Thanks again, Frizzle.

Reply via email to