We need to hide a certain field namely "Specify the reason of Critical Priority" (Custom Field value 10112 ) based on Priority field value. We need to show this only when Priority Value is "Critical"
We have write java script in "Specify the reason of Critical Priority" field's description to meet this expectation. Please find the javasripr below -
<script type="text/javascript">
priority = document.getElementById('priority');
if (priority) {
target = document.getElementById('customfield_10112');
// Hide the target field if priority isn't critical
if (priority.value != 2) target.style.display='none';
priority.onchange=function() {
if (this.value == 2) {
target.style.display = '';
target.value="enter message here";
} else {
target.style.display='none';
}
}
}
</script>
After configuring by above mentioned procedure "Specify the reason of Critical Priority" field is showing only when "Critical" priority is selected. When "Critical" Priority is not selected this field is not showing alright but "Specify the reason of Critical Priority" Custom Field name is showing everytime. Means Field is hideing but fieldname is showing. Could you please suggest regarding this?