Having trouble with hiding entire field based on output from a previous field.

So, first I have all of 3 hour of exposure to javascript, so bare with me.

<script type="text/javascript">
checkbox = document.getElementById('customfield_11540-1');
dept = document.getElementById('customfield_11534');
prog = document.getElementById('customfield_11537');
func = document.getElementById('customfield_11533');
// Hide the target field by default
dept.style.display = '';
prog.style.display = 'none';
func.style.display = 'none';

checkbox.onclick=function() {
if (checkbox.checked) {
prog.style.display = '';
func.style.display = '';
dept.style.display = 'none';
} else {
prog.style.display = 'none';
func.style.display = 'none';
dept.style.display = '';
document.getElementById('customfield_11534').value = '';



Ive pieced together this from previous posting on the subject.

So it does sort of work, the fields for prog and func are drop menus, and it hides the menu part, but not the field label. I read that from Jira4.2 and newer, were supposed to use .parentNode; to include the entire container, that breaks the script in my case. Kind of scratching my head getting the intended outcome.

1 answer

Disregard, I forgot to refresh my second page that I was using to test the create issue.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,294 views 5 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you