If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Prompt not working after changing selections /w Javascript

Started by Dulanic, 20 Feb 2014 12:59:22 PM

Previous topic - Next topic

Dulanic

I have a prompt page /w a checkbox group. I used the code from:

http://www.cognoise.com/index.php?topic=17818.0

I added this to the page:

<script language="javascript">
function clickDeselectAll()
{
   var checkbox = window.event.srcElement.parentNode.parentNode.parentNode.parentNode.parentNode;
   checkbox.getElementsByTagName("a")[1].click();
   window.event.srcElement.ariaChecked=true;
   window.event.srcElement.checked=true;
   window.event.srcElement.parentNode.className += " " + 'dijitCheckBoxChecked';
}

function uncheckAll()
{
   var checkbox = window.event.srcElement.parentNode.parentNode.parentNode.parentNode.parentNode;
   checkbox.getElementsByTagName('input')[0].checked="";
   checkbox.getElementsByTagName('input')[0].ariaChecked="false";
   checkbox.getElementsByTagName('input')[0].parentNode.className = "dijitInline dijitCheckBox";
}
</script>


Along /w this:

<script>
var checkboxes = document.getElementById('Prompt1').getElementsByTagName('input');
checkboxes[1].attachEvent('onclick',clickDeselectAll);

var i = 0;
for (i=2;i<checkboxes.length;i++)
{
checkboxes[i].attachEvent('onclick',uncheckAll);
}
</script>


It works great... except for when they click the top option "None"... it deselects all except the top option "None" but then the prompt button is grayed out.. like it isn't registering that None is selected?