Javascript program not working as expected while adding new entry in the list

Santosh Singh May 26, 2021

We have written a Javascript program that when an option is selected from Team Assignment Single List field then a group will be automatically selected from Team Assignment group. But it failed after we added new option in Team Assignment Single List field. 

You can see the below code

<script type="text/javascript">
team = document.getElementById('customfield_14100');
if (team) {
target = document.getElementById('customfield_14101');

team.onchange=function() {
if (this.value == 13300) {
target.value = "XXX-XXX-XXX";
}
else if (this.value == 14204) {
target.value = "XXX-TSO-SAS"
}
else {
target.value = "Unmapped value: " + this.value;
}
}
}
</script>

 

Above program is working well for other option like 13300 and returning mentioned group (target value) .For the option id 14204 it is going to else loop and returning its target value Unmapped value: 14204 .even option id is correct and group name is also correct.

 

1 answer

0 votes
Nir Haimov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 31, 2021

Hi @Santosh Singh 

Can you be more specific?

What you are trying to do and what is not working?

what is happening instead of what you really wanted to happen?

Screenshots may help too

Suggest an answer

Log in or Sign up to answer