I have this image gallery in which clients should be able to determine the order in which their images are shown. The sortable part works. Then I want to pass the new order to the next page called act_writeneworder.cfm (i am using coldfusion)
I just started with jQuery and it is driving me nuts:-) Each time I think I am having it well i am testing and the variable passed through gives an empty string.
My code:
Then an unordered list:Code:<script type="text/javascript"> $(function() { $( "#ulsortable" ).sortable(); }); $('#frm_sort').submit(function(){ sort_serialized = $('#ulsortable').sortable('serialize'); }); </script>
The variable sort_serialized is a hidden field in the form:Code:<ul id="ulsortable"> <cfoutput query="items"> <li id="myprimarykey_#T_items_itemid#"> <img src="../#session.foldername#/galleries/#T_items_itemid#_thumbsitemanager.#T_items_img1#" alt="" border="0" width="125" height="125"> <br> <CFIF #T_items_title# IS NOT "">#left("#T_items_title#","15")#</CFIF> </li> </cfoutput> </ul>
I am open to any other methods that do the same (but better:-))Code:<form action="actions/act_writeneworder.cfm" method="post" id="frm_sort"> <input type="hidden" name="sort_serialized" id="sort_serialized" value="" /> <input type="submit" name="save" id="save" value="save" /> </form>



Reply With Quote
Bookmarks