I am using following code snippet in Description to populate the value in field B depending on what value is selected from field A, using field A onchange trigger.
<script type="text/javascript">
sid = document.getElementById('customfield_10087');
if (sid) {
target = document.getElementById('customfield_10097');
if (sid.value == "ABBOTSFORD PUBLIC SCHOOL (ABBOTSFORD)") target.value="hi this is done";
sid.onchange=function() {
target.value=this.value
}
}
</script>
Field A is select list but when in use field A.Value in my code it returns a number instead of the literal value of the selection. I have to populate filed B based on what is selected in field A but I am not able to compare as I said the value returned is number and the not the literal value that I select.
My second if statement above never returns true because sid.value is returned as a number or id of "ABBOTSFORD PUBLIC SCHOOL (ABBOTSFORD)"
How do I map this id to my literal value?