How can we copy values from one cascade select list to another using javascript?

S July 27, 2013

I was trying to copy values from one cascade select list to another. It is fairly easy to copy the first value using something like

var x= document.getElementById('customfield_10000');

var xSecondValue= document.getElementById('customfield_10000:1');

var y= document.getElementById('customfield_20000');

var ySecondValue= document.getElementById('customfield_20000:1');

y.selectedIndex= x.selectedIndex;

But this does not trigger any event to refresh the values of second list for custom field y so that I can say

ySecondValue.selectedIndex= xSecondValue.selectedIndex;

Is there a way to solve this problem? Thanks in advance

2 answers

0 votes
S July 28, 2013

None other than I am more comfortable with js :) . It is part of an elaborate script.

0 votes
Eva
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 28, 2013

is there a reason you want to copy it only using js and not groovy script?

Suggest an answer

Log in or Sign up to answer