Hi All,
Oflate, I have been trying to get a hang of how to use the "HTML item" in Report Studio reports and would appreciate if peolple can contribute right from basics towards it.
Issue:
1) On the prompt page I have included a : value prompt . In the properties panel I have set: Select UI as "Check Box group" and Multi-Select as "Yes" with Name as "S" ; and in Static Choices I have created three variables.
Hence on running the prompt page 3 check boxes appear
Requirement: I wish to display an alert box when 1st check box is checked.
javascript code which I have used to do this is as follows:
<script>
function disp_alert()
{
alert(document.getElementById("selectValueS").id)
}
</script>
this displays the ID of the value prompt used which has been generated by Cognos. However I am unable to gain access to the array item one of the check box array.
Also, I wish to understand how I can access the value prompt using the following DOM syntax:
document.formWarpRequest.checkBoxListS.id
Is the above sysntax correct and can be used in place of document.getElementById("selectValueS").id somehow? if yes then whats the appropriate method.
Any help or ideas would be greatly appreciated .
Thanks ,
Bhambry
Check support.cognos.com and search for the KB document 1019917.1. This would help you with displaying an alert when checkbox is checked. You can reference the checkbox using document.formWarpRequest._oLstChoicesAAA where AAA is the name of the checkbox. The functions inside the checkbox prompt can be referred using checkBoxListAAA.<function_name> where AAA is the name of the checkbox and function name can be any inbuilt javascript function in the prompting folder inside webcontent. For example checkBoxListAAA.m_bRequired() will make the checkbox as satisfying required conditions when default values are selected in the checkbox. Hope this helps you
A sample from cognos.com
if (document.forms["formWarpRequest"].elements["_oLstChoicesBBB"].checked)
alert("Checkbox is checked");
else
alert("Checkbox is not checked");
Yes this was the program given in the KB document I had mentioned.
Quote from: bharathkv on 23 Jan 2008 12:04:31 AM
Check support.cognos.com and search for the KB document 1019917.1. This would help you with displaying an alert when checkbox is checked. You can reference the checkbox using document.formWarpRequest._oLstChoicesAAA where AAA is the name of the checkbox. The functions inside the checkbox prompt can be referred using checkBoxListAAA.<function_name> where AAA is the name of the checkbox and function name can be any inbuilt javascript function in the prompting folder inside webcontent. For example checkBoxListAAA.m_bRequired() will make the checkbox as satisfying required conditions when default values are selected in the checkbox. Hope this helps you
Hi Bharat,
Thanks for your reply I have doubt and wish to know if it is possible to change the color of the multi select value prompt border somehow?
Thanks and Regards,
Saurabh