Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Show/hide Field Based on Field Selection

Todd Winton
Contributor
February 26, 2018

Looking at this post, it appears to be possible to hide customer fields by adding a script to the description of the field to display or hide.  My question is, how would I do this if the field A is a cascading multi-select list.  I found a similar script if the field A is a single select, but am not sure how to get the same results from a cascading multi-select list.

 

<script type="text/javascript">
jQuery(document).ready(function($) {
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) {
callChangeFunction();
});
callChangeFunction();
function callChangeFunction(){
showHidField();
// dropdown custom field change function
$("#customfield_ID1").change(function() {
showHidField();
});

}

function showHidField(){
//drop down field selected value
var dropDownFieldval =$.trim($("#customfield_ID1 :selected").text());
//test field1
$("#customfield_ID2").closest('div.field-group').hide();
if(dropDownFieldval == 'Design'){
$("#customfield_ID2").closest('div.field-group').show();
}else
$("#customfield_ID2").closest('div.field-group').hide();

}

});

</script>

 

0 answers

Suggest an answer

Log in or Sign up to answer