jquery and serialize / passing variables
I already put this question on the jquery forum but noone responded. My question is about jquery.
I have this image gallery, people can drop and drag pictures, the idea is they can determine theirselves the order in which images are shown on their website.
I have the sortable part, but I don't know how to pass the new order to the next page that should contain a query that updates the ordernumber for each item.
My code:
<!--- load the necessary scripts --->
<script src="scripts/jquery-1.6.2.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js" type="text/javascript"></script>
<script src="http://jquery-ui.googlecode.com/svn/tags/latest/external/jquery.bgiframe-2.1.2.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/i18n/jquery-ui-i18n.min.js" type="text/javascript"></script>
,!--- the actual sortable image gallery --->
<ul id="ulsortable">
<cfoutput query="items">
<li id="ID_#T_items_autoID#">
<CFIF #T_items_img1# IS NOT 0>
<img src="../#session.foldername#/galleries/#T_items_itemid#_thumbsitemanager.#T_items_img1#" alt="Click here to update" border="0" width="125" height="125">
<CFELSE>
<img src="layoutimg/no_picture_available.jpg" alt="" width="125" height="125" border="0">
</CFIF><br>
<CFIF #T_items_title# IS NOT "">#left("#T_items_title#","15")#</CFIF>
</li>
</cfoutput>
</ul>
<script>
$(function() {
$( "#ulsortable" ).sortable();
$( "#ulsortable" ).disableSelection();
});
$('#frm-sort').submit(function(){
var sort_serialized = $("#ulsortable").sortable("serialize");
});
</script>
<form action="#request.site.webroot#/actions/act_writeneworder.cfm" method="post" id="frm-sort">
<input type="submit" name="save" id="save" value="save" />
<input type="hidden" name="sort_serialized" id="sort_serialized" value="" />
</form>
When I use this and go to the next page thrugh submit button I get the error that sort_seriallized is an empty string. i must be doing something wrong. It has been 3 days i am on it:-)
