Java script not working

I have two custom fields.One select field .I need one description field to be filled if answe is No

<script type="text/javascript">

FeatureToggle = document.getElementById('12000');

if (FeatureToggle) {

target = document.getElementById('12100');

if (FeatureToggle =='Yes') target.style.display='none';

FeatureToggle.onchange=function() {

if (this.value =='No') {

target.style.display = '';

target.value="Why feature toggle is No";

} else {

target.style.display='none';

}

}

}

</script>

2 answers

0 vote

And your question is ... ?

  1. Please put your code in a code block to improve visibility
  2. What else have you tried?
    1. Already debugged your Javascript code? How should this work? For instance FeatureToggle is an element, how should this be "Yes"?
  3. Put your code in
    jQuery(function(jQuery){ // Your code here});
    to be sure, it is loaded after all elements are rendered.
  4. Use jQuery to add event listeners, find and alter elements, to be sure you are cross browser compatible

is this script correct.Its not working after adding it.Also i added in here custom fields---)right click ---)configure ---)description.

please advise.Als advise if there is anyother script for the requirement

Hi,

Thanks for looking.

I have a select list with yes or No that is FeatureToggle .My requirement is if user selects no he should give expalanation.So i created another field which is a text field.I need this mandatory/fill if he selects no.

Kindly help

Have you tried Adrien's suggestions yet? Repeating the question is of no help, you need to think through the responses you get and respond to them with more information.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,316 views 14 20
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot