/* mutex: only one form element with the class 'mutex' may be used at a time.
   all others will be disabled until it is blank. */
$(document).ready(function(){
    $(".mutex").change(mutex);
    $(".mutex[value]").change();
    $(".mutex").attr("required", null)
});

function mutex() {
    var $me = $(this);
    var $other = $('.mutex').not($me);
    if ( $me.val() != '' ) {
        $other.attr('disabled', 1);
        $("#mutex_field").val($me.val())
        $("#mutex_field").change()
    } else {
        $other.removeAttr('disabled');
        $("#mutex_field").val($other.val())
        $("#mutex_field").change()
    }
}

@@ -166,30 +166,50 @@
 $(%22.
-mutex%22).change(
+form-group%22).on(%22change%22, %22.mutex%22, 
 mutex)
-;
 %0A   
@@ -277,16 +277,193 @@
 , null)%0A
+    $('.multi_value.form-group', this.form).bind('managed_field:remove', function() %7B %0A      $(%22#mutex_field%22).val($(%22.mutex%5Bvalue%5D%22).val());%0A      $(%22.mutex%22).change();%0A    %7D)%0A
 %7D);%0A%0Afun

Fix up mutex checks for edit