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

This widget could not be displayed.

And your question is ... ?

This widget could not be displayed.
  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 Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

82 views 1 0
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