Simon Corless schrieb:
> Quite simple I hope, I am attempting an inline editing idea. Click a
> span containing tags and it changes to an input box.
> 
> The problem I have is I can't access the <form> that is put onto the
> page. I assume jQuery doesn't know it exists because it's not in the
> DOM? Do I need to add the form in a special way?
> 
> I add it by making the <span> .html("<form>...<input
> type="reset">...</form>") into the form.
> 
> Then I am trying to access the submit button and the reset button,
> what is the selector for these? (Not had much luck as I can't get the
> first bit to work!!).
> 
> For what it's worth I've been exploring other inline editor plugins
> but can't see anything different.
> 
> Thanks.
> 
> Simon

Simon, a span element must not contain a form element. If you do that 
anyway a selector isn't really predictable, because browsers most 
probably close the span implicitly before the form starts.

So the DOM will look like:

<span> ... </span>
<form> ... </form>

instead of <span><form> ... </form></span> what you might expect.

Change the span to a div and try again - scripting on top of a broken 
DOM is not reliable.



-- Klaus



-- 
Klaus

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to