
function double_list_move(src, dest)
{
  for (var i = 0; i < src.options.length; i++)
  {
    if (src.options[i].selected)
    {
      dest.options[dest.length] = new Option(src.options[i].text, src.options[i].value);
      src.options[i] = null;
      --i;
    }
  }
}

function double_list_submit()
{
  var form = $('sf_admin_edit_form');
  var element;

  // find multiple selects with name beginning 'associated_' and select all their options
  for (var i = 0; i < form.elements.length; i++)
  {
    element = form.elements[i];
    if (element.type == 'select-multiple')
    {
      if (element.className == 'sf_admin_multiple-selected')
      {
        for (var j = 0; j < element.options.length; j++)
        {
          element.options[j].selected = true;
        }
      }
    }
  }
}

@@ -293,20 +293,101 @@
 _submit(
-)%0A%7B%0A
+form_name)%0A%7B%0A  // default id to allow using a custom form id%0A  if( ! form_name ) %7B%0A  
   var fo
@@ -392,13 +392,16 @@
 form
+_name
  = 
-$(
 'sf_
@@ -416,16 +416,47 @@
 it_form'
+;%0A  %7D%0A%0A  var form = $(form_name
 );%0A  var

allow using a custom form id (closes #1899)