I'm using Scriptaculous and CF8 to create a "stacked" PDF based on a user's re-ordering of a list of uploaded files (you can check out the live app here). In order to do this simply, I'm making the file name part of the sortable list item's ID value, like so: ID="file~#filename#" . Well, Scriptaculous has a built in way of dealing with sortable item ID values, where it's looking for some text followed by an underscore followed by a numeric value. In order to break away from this assumption, the latest version of Scriptaculous (1.8.2) offers an option called "format" that allows you to specify a regular expression to override the default one.
So, here's my code that creates the unordered list of files:
<li id="file~#name#" class="fileitem" ext="#listlast(name,".")#">#name#</li>
and here's the JS I use to turn this list into a sortable:
Executing the following JS will show you that the regex is correct:
Not hard stuff, but it took me a while to piece it all together so I thought I'd share in case it saves someone else a little time.