Scriptaculous Sortable Create onUpdate Event Not Firing

• Bill Hunt

I’ve been having trouble with a Scriptaculous sortable object that wasn’t catching the onUpdate function I’d assigned. In this case, I was using an UL for the parent with LIs inside. After digging into the code, I discovered that there are several criteria that must be for the actual items that are going to be sortable, or else the event won’t fire. These are:

  1. Each item must have a unique id.
  2. The item id must contain an underscore (_)
  3. The item id cannot begin with an underscore or a hyphen

Using myname_## should work fine, as long as ## is a unique integer in each case. Technically, it must match the following regular expression: