IBM Business Analytics

 View Only

Cognos 11.0.8 Uncheck default on optional date prompt

  • 1.  Cognos 11.0.8 Uncheck default on optional date prompt

    Posted Wed March 27, 2019 09:06 AM
    ​In Cognos 11.0.8 I am trying to uncheck the default for the optional date prompt for users. In the past JS worked, however when trying to use the scripts found online they fail on (var i = 0; i < node_list.length; i++). Is it the code or is it that 11.0.8 does not support JS any longer? Is there another work around?


    Insert an HTML item into the prompt page and place it on the right of the prompt. Double click on this item and insert the following Javascript code:

    <SCRIPT TYPE="text/javascript">
    function init()
    {
    // need to find all the checkboxes on the page for the date prompt
    // and set to false
    var node_list = document.getElementsByTagName('input');
    for (var i = 0; i < node_list.length; i++)
    {
    var node = node_list[i];
    if (node.getAttribute('type') == 'checkbox')
    {
    // find the dateselection checkbox chkAnyValue
    var currentCheckBox = node.name;
    if (currentCheckBox.indexOf("chkAnyValue")!= -1 )
    {
    node.checked=false;
    if (node.fireEvent)
    {
    // IE, IE is not changing the value of the checkbox
    // when calling the event.
    node.fireEvent("onclick");
    }
    else if (node.dispatchEvent)

    {
    // Firefox, calling this event would change the value
    // of the checkbox. You might need to set it to true
    // first.
    var e = document.createEvent("MouseEvents")
    e.initEvent("click", true, true);
    node.dispatchEvent(e);
    }
    }
    }
    }
    }
    init();
    </SCRIPT> 

    Click OK. When running the report the Check box will be disabled by default.



    ------------------------------
    Janice Rosche
    ------------------------------