Topic
  • 4 replies
  • Latest Post - ‏2013-09-30T20:47:58Z by Nandagopal
Nandagopal
Nandagopal
5 Posts

Pinned topic Value Prompt(check box) - How to Deselect the Default Selection

‏2013-09-25T22:03:53Z |

How to Deselect the Default Selection from the Value Prompt (Check Box).

I have static choice ALL as default selection in the Value Prompt.

Whenever user selects any other values in the Value Prompt, need to uncheck the Default Selection (ALL).

Anyone has any idea to acheive this Functionality

  • OpherB
    OpherB
    664 Posts

    Re: Value Prompt(check box) - How to Deselect the Default Selection

    ‏2013-09-26T15:32:54Z  

    I go through defining how to check all by default here: http://www.cubeert.com/index.php?option=com_content&view=article&id=8:check-all-checkboxes&catid=1:tips&Itemid=4

     

    You might want to use that approach, or edit it as needed to turn off 'All' when any other is selected.

    Good luck,
    Opher

     

  • Nandagopal
    Nandagopal
    5 Posts

    Re: Value Prompt(check box) - How to Deselect the Default Selection

    ‏2013-09-26T21:46:37Z  
    • OpherB
    • ‏2013-09-26T15:32:54Z

    I go through defining how to check all by default here: http://www.cubeert.com/index.php?option=com_content&view=article&id=8:check-all-checkboxes&catid=1:tips&Itemid=4

     

    You might want to use that approach, or edit it as needed to turn off 'All' when any other is selected.

    Good luck,
    Opher

     

    Thanks Opher B for the work around. Let me propose this one as an alternate option.

    I have got another requirement. There are two optional prompts(where default selection is ALL). but if user selects any value on the first prompt, I need to disable the 2nd one and vice versa (if user selects any value on the 2nd one the 1st one needs to be disabled).

    Can you help me here..

  • OpherB
    OpherB
    664 Posts

    Re: Value Prompt(check box) - How to Deselect the Default Selection

    ‏2013-09-30T18:13:16Z  

    Thanks Opher B for the work around. Let me propose this one as an alternate option.

    I have got another requirement. There are two optional prompts(where default selection is ALL). but if user selects any value on the first prompt, I need to disable the 2nd one and vice versa (if user selects any value on the 2nd one the 1st one needs to be disabled).

    Can you help me here..

    I have not written anything to disable prompts, but there are scripts posted here and in other locations. Google search for "Javascript disable cognos prompt conditional" should give you good results.

    Good luck,
    Opher

     

  • Nandagopal
    Nandagopal
    5 Posts

    Re: Value Prompt(check box) - How to Deselect the Default Selection

    ‏2013-09-30T20:47:58Z  
    • OpherB
    • ‏2013-09-30T18:13:16Z

    I have not written anything to disable prompts, but there are scripts posted here and in other locations. Google search for "Javascript disable cognos prompt conditional" should give you good results.

    Good luck,
    Opher

     

    Hi ALL,

     

    I got the code for the requests that I am looking for.. This works perfectly fine at my end.

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

    HTML Item1:

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

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

     

    HTML Item 2:

    <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>

     

    Wrap the prompt with the name Prompt1 using div id