[Rt-commit] rt branch 5.0/support-multipe-checkbox-cfs created. rt-5.0.5-155-g88f76835f8
BPS Git Server
git at git.bestpractical.com
Tue Feb 6 14:40:16 UTC 2024
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".
The branch, 5.0/support-multipe-checkbox-cfs has been created
at 88f76835f8ea290a5ccc02d48078725ef0e8f5f2 (commit)
- Log -----------------------------------------------------------------
commit 88f76835f8ea290a5ccc02d48078725ef0e8f5f2
Author: sunnavy <sunnavy at bestpractical.com>
Date: Tue Feb 6 09:28:59 2024 -0500
Dynamically get target element from the display element for checkbox cfs
The "id" var is a global variable that's shared the whole page, for pages
that have multiple checkbox cfs, previously changing any display element
would always change the value of the last hidden checkbox input, which the
final id value points to.
diff --git a/share/html/Elements/EditCustomFieldSelect b/share/html/Elements/EditCustomFieldSelect
index a6f23854c2..8559c2ea4a 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'));
});
</script>
% } else {
-----------------------------------------------------------------------
hooks/post-receive
--
rt
More information about the rt-commit
mailing list