COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: aamuktha on 11 May 2009 05:47:14 AM

Title: how to remove the prompt name&underline in the value prompt using JS in 8.4?
Post by: aamuktha on 11 May 2009 05:47:14 AM
hi all

the following script is used in 8.2 for the same. Please kindly help me out ,how to convert this script in 8.4 for the same function.?

JS logic in 8.2

<script language="javascript">
document.forms["FormWarpRequest"].elements["_oLstChoicesX"].remove(0);
document.forms["FormWarpRequest"].elements["_oLstChoicesX"].remove(0);
</script>


Thanks in advance


Title: Re: how to remove the prompt name&underline in the value prompt using JS in 8.4?
Post by: Gopinath on 11 May 2009 08:34:16 AM
Try

<script language="javascript">
getFormWarpRequest()._oLstChoicespromptname.remove(0);
getFormWarpRequest()._oLstChoicespromptname.remove(0);
</script>
Title: Re: how to remove the prompt name&underline in the value prompt using JS in 8.4?
Post by: dlafrance on 21 May 2009 09:55:42 AM
I have tryed the following solution in 8.4 FP1, but i got a JS error showing that "the list is null or not an object".

I put an html item in my prompt page with this :

<script language="javascript">
getFormWarpRequest()._oLstChoicesPeriode.remove(0);
getFormWarpRequest()._oLstChoicesPeriode.remove(0);
</script>

My prompt name is of course Periode.

Is there something i'm doing wrong ?
Title: Re: how to remove the prompt name&underline in the value prompt using JS in 8.4?
Post by: Gopinath on 22 May 2009 02:09:04 AM
Try the following code.

<script language="javascript">
var fW = (typeof getFormWarpRequest == "function" ? getFormWarpRequest() : document.forms["formWarpRequest"]);
fW._oLstChoicesPeriode.remove(0);
fW._oLstChoicesPeriode.remove(0);
</script>

Title: Re: how to remove the prompt name&underline in the value prompt using JS in 8.4?
Post by: aamuktha on 22 May 2009 04:45:33 AM
hi Gopinath

the script which u have sent for the first time is not worked .

<script language="javascript">
var f = getFormWarpRequest();
var list = f._oLstChoicesCUNT;

list.remove(1);
list.remove(0);
list.removeAttribute("hasLabel");
</script>

CUNT is the prompt name.


this script is working fine.


Thanks
Title: Re: how to remove the prompt name&underline in the value prompt using JS in 8.4?
Post by: dlafrance on 22 May 2009 03:12:47 PM
Hi,

Instead of deleting the 2 firsts rows, i have done this trick wich works too...

I have put a first html item before the prompt wich contain : <span id="Period">

I have put a second html item right after the prompt wich contain : </span><script>
document.getElementById('Period').style.display = 'none'; //hide </script>

After the finish button there is another html item :
<script>

var mySpan = document.getElementById("Period");
var myInput = mySpan.getElementsByTagName("select");

myInput[0].selectedIndex = 2

</script>

In fact, i have a hidden prompt wich have a cascading source. It have always only 1 option in it and this is why i have selected the first item in it (index = 2).

Thank you for your help, i know my solution is not for the same problem, but i tryed with your solution without success.