Richard Paul
2005-Aug-10 17:45 UTC
[Rails-spinoffs] Reordering lists dissociates nested input elements from form.
I am attempting to use drag and drop to reorder elements then submit the form to store the changes. Each element (<li>) has text and a nested hidden input element. The problem I am experiencing is that when the form is submitted any of the elements that have been moved are not submitted. Inspecting the DOM shows that the inputs are still nested with the elements. But for some reason they no longer seem to be associated with the form. Am I doing something wrong or do the input elements need to be reassociated with the form? Thanks in advance, Richard. :: Code Snippet :: <form ...> <ul id="selected" > <c:forEach var="item" items="${search.filter.layout.displayColumns}"> <li class="layoutItem" style="cursor:move;"> ${item.displayName} <input type="hidden" name="displayColumn" value="${item.displayName}"/> </li> </c:forEach> </ul> <script type="text/javascript" language="javascript"> // <![CDATA[ Sortable.create("selected", {containment:["selected"]}); // ]]> </script> </form>