Need Help!!
We have four singe list fields - BRS Types, CUPPS Types, CUSS Types, FIDS Types
one multilist field - components
Below is the script -
<script type="text/javascript">
Components = document.getElementById('customfield_15153');
if (Components) {
target = document.getElementById('customfield_15078');
target1 = document.getElementById('customfield_15080');
target2 = document.getElementById('customfield_15082');
target3 = document.getElementById('customfield_15081');
if (Components.value != 15135)
{
target.style.display='none';
AJS.$('label[for="customfield_15078"]').hide();
}
if (Components.value != 15136)
{
target1.style.display='none';
AJS.$('label[for="customfield_15080"]').hide();
}
if (Components.value != 15137)
{
target2.style.display='none';
AJS.$('label[for="customfield_15082"]').hide();
}
if (Components.value != 15139)
{
target3.style.display='none';
AJS.$('label[for="customfield_15081"]').hide();
}
Components.onchange=function() {
if (this.value == 15135) {
target.style.display = '';
AJS.$('label[for="customfield_15078"]').show();
target1.style.display='none';
AJS.$('label[for="customfield_15080"]').hide();
target2.style.display='none';
AJS.$('label[for="customfield_15082"]').hide();
target3.style.display='none';
AJS.$('label[for="customfield_15081"]').hide();
}
else if (this.value == 15136)
{
target1.style.display='';
AJS.$('label[for="customfield_15080"]').show();
target.style.display='none';
AJS.$('label[for="customfield_15078"]').hide();
target2.style.display='none';
AJS.$('label[for="customfield_15082"]').hide();
target3.style.display='none';
AJS.$('label[for="customfield_15081"]').hide();
}
else if (this.value == 15137)
{
target2.style.display='';
AJS.$('label[for="customfield_15082"]').show();
target.style.display='none';
AJS.$('label[for="customfield_15078"]').hide();
target1.style.display='none';
AJS.$('label[for="customfield_15080"]').hide();
target3.style.display='none';
AJS.$('label[for="customfield_15081"]').hide();
}
else if (this.value == 15139)
{
target3.style.display='';
AJS.$('label[for="customfield_15081"]').show();
target.style.display='none';
AJS.$('label[for="customfield_15078"]').hide();
target1.style.display='none';
AJS.$('label[for="customfield_15080"]').hide();
target2.style.display='none';
AJS.$('label[for="customfield_15082"]').hide();
}
else if (this.value == 15135 && this.value == 15136) {
target.style.display = '';
AJS.$('label[for="customfield_15078"]').show();
target1.style.display='';
AJS.$('label[for="customfield_15080"]').show();
target2.style.display='none';
AJS.$('label[for="customfield_15082"]').hide();
target3.style.display='none';
AJS.$('label[for="customfield_15081"]').hide();
}
else if (this.value == 15135 && this.value == 15137) {
target.style.display = '';
AJS.$('label[for="customfield_15078"]').show();
target2.style.display='';
AJS.$('label[for="customfield_15082"]').show();
target3.style.display='none';
AJS.$('label[for="customfield_15081"]').hide();
target1.style.display='none';
AJS.$('label[for="customfield_15080"]').hide();
}
else if (this.value == 15135 && this.value == 15139) {
target.style.display = '';
AJS.$('label[for="customfield_15078"]').show();
target3.style.display='';
AJS.$('label[for="customfield_15081"]').show();
target1.style.display='none';
AJS.$('label[for="customfield_15080"]').hide();
target2.style.display='none';
AJS.$('label[for="customfield_15082"]').hide();
}
else if (this.value == 15136 && this.value == 15137) {
target1.style.display='';
AJS.$('label[for="customfield_15080"]').show();
target2.style.display='';
AJS.$('label[for="customfield_15082"]').show();
target.style.display='none';
AJS.$('label[for="customfield_15078"]').hide();
target3.style.display='none';
AJS.$('label[for="customfield_15081"]').hide();
}
else if (this.value == 15136 && this.value == 15139) {
target1.style.display='';
AJS.$('label[for="customfield_15080"]').show();
target.style.display='none';
AJS.$('label[for="customfield_15078"]').hide();
target3.style.display='';
AJS.$('label[for="customfield_15081"]').show();
target2.style.display='none';
AJS.$('label[for="customfield_15082"]').hide();
}
else if (this.value == 15137 && this.value == 15139) {
target2.style.display='';
AJS.$('label[for="customfield_15082"]').show();
target3.style.display='';
AJS.$('label[for="customfield_15081"]').show();
target.style.display='none';
AJS.$('label[for="customfield_15078"]').hide();
target1.style.display='none';
AJS.$('label[for="customfield_15080"]').hide();
}
}
}
</script>
Error - selection is not working properly, showing fields in the wrong sequence.
Please Suggest.
Thanks in Advance!!