In a Cognos report i have 2 checkbox prompts named :
- ChoicesIndicator1_VALUE
- ChoicesIndicator1_VALUE_b1
When the first one is clicked / unchecked, the second one has to also be unchecked.
I can’t do this with Cognos so i’m using javascript.
The idea is as follows :
<script>
var form = getFormWarpRequest();
var myList = form._oLstChoicesIndicator1_VALUE
var myListb1 = form._oLstChoicesIndicator1_VALUE_b1
myList.onclick = function() {myFunction()};
function myFunction()
{
if(myList.checked == true)
{
myList.checked = false;
}
}
</script>
The if is working but not the “myList.checked = false”; (an alert(“hello”); is working).
So i guess there’s something wrong.
Note : i’d rather use the prompt name if possible. If the prompt ID is needed, can it be attached to the prompt with JS code ?
Anybody knows how to correct this ?
Thanks a lot ! I’m a javascript beginner.
Regards,
Antoine
user26041991 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.