diff --git a/share/html/Elements/EditCustomFieldSelect b/share/html/Elements/EditCustomFieldSelect index a6f23854c20..8559c2ea4ac 100644 --- a/share/html/Elements/EditCustomFieldSelect +++ b/share/html/Elements/EditCustomFieldSelect @@ -93,7 +93,8 @@ var id = <% $name |n,j %>; id = id.replace(/:/g,'\\:'); jQuery('#' + id + '-Display').change(function() { - jQuery('#' + id).val(jQuery(this).is(':checked') ? jQuery(this).data('checked-value') : jQuery(this).data('unchecked-value')); + var target = jQuery(this).attr('id').replace(/-Display$/, '').replace(/:/g,'\\:'); + jQuery('#' + target).val(jQuery(this).is(':checked') ? jQuery(this).data('checked-value') : jQuery(this).data('unchecked-value')); }); % } else {