Opened 14 years ago
Closed 14 years ago
#314 closed defect (invalid)
Form Elements Inside Dialog Widgets
Reported by: | Owned by: | anonymous | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Widgets | Version: | 0.2 |
Keywords: | dialog, widget, moveChildren, buildFromTemplate | Cc: | |
Blocked By: | Blocking: |
Description
If <form />
elements are inside the content of a Dialog widget then those <form />
elements are lost once the widget has been rendered.
The render process involves attaching the declared widget content to a new <div />
as a new child of the <body />
(i.e. at the bottom). To perform this task the dojo.dom.moveChildren
method is called from the buildFromTemplate
method. Within moveChildren
the child nodes are removed from the original element and appended to the new element (using appendChild
and firstChild
). It seems that this process does not result in the closing </form>
tag being rendered to the client, resulting in the missing form in the resulting dialog.
I have been able to work round the problem by changing the moveChildren
method to simply doing a: destNode.innerHTML = srcNode.innerHTML;
and dojo.dom.removeChildren(srcNode);
, which does result in the correct content being rendered in the dialog.
It is unclear to me why it is necessary to perform the destructive moveChildren
method in this case of relocating declared content to it's rendered location. In fact the, now empty, source node does in fact appear to be rendered in the dialog as well :S Perhaps it would be simpler (and possibly faster) to just append the source node to the attach point in the dialog template.
Attachments (1)
Change History (4)
comment:1 Changed 14 years ago by
Changed 14 years ago by
Attachment: | 314-test_Dialog.html added |
---|
test_Dialog page that shows the problem when the dialog widget is contained within a form.
comment:2 Changed 14 years ago by
Isn't this just a bigger problem with forms not being nestable in general? So are you asking us to workaround this limitation with the html forms rec.?
comment:3 Changed 14 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
sorry, you can't have a <form> inside another <form>. it's invalid html.
I have managed to track this down to occuring when there is a
<form />
element that contains the Dialog widget.The attached file illustrates this problem.