$("[name$='[rights_type]']", subform).change(function (event) {
      var type = $(this).val();

      var values = {};