Is there any provision or method to check only one checkbox at a time using Javascript?

Mohammed Siyad July 7, 2021

Hi,

I want to check only one checkbox at a time out of the two, can someone help me how to implement this in javascript in field description. Currently I am using Jira 8.13.4 jira dc edition. 

<script>
$(document).ready(function(){
$('input:#customfield_13266-1,#customfield_13266-2').click(function() {
$('input:#customfield_13266-1,#customfield_13266-2').not(this).prop('checked', false);
});
});
</script>

The script above worked before but after the upgrade to jira 8.13.4 its not working.



1 answer

1 vote
Brant Schroeder
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 21, 2021

@Mohammed Siyad 

Are you trying to prevent multiple checkboxes from being selected.  If that is the case why not just use the radio button custom field?

Shahrul Saifuddin January 4, 2023

Good Answer. 

Suggest an answer

Log in or Sign up to answer