COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: everlearner on 26 Jun 2012 06:41:53 AM

Title: value prompt java script?
Post by: everlearner on 26 Jun 2012 06:41:53 AM
Hi all,

how to display the selected value in value prompt by using java script?

that selected value i have to check before clicking on FINISH?
Title: Re: value prompt java script?
Post by: pricter on 26 Jun 2012 06:44:29 AM
The following url shows some basic techniques using javascript

http://www-01.ibm.com/support/docview.wss?uid=swg21376964 (http://www-01.ibm.com/support/docview.wss?uid=swg21376964)
Title: Re: value prompt java script?
Post by: everlearner on 26 Jun 2012 08:43:02 AM
thanks for ur reply, i have used that doc only for the reference. the following i have written to get the value.

<SCRIPT type="text/javascript">

var form = getFormWarpRequest();

var VPT  = form._oLstChoicesV;

var val = VPT.options[0].selected.value;/ var val=VPT.options[0].value; ( tried both)
alert(val);

</SCRIPT>

but am unable to get the selected value. tell me how wud i get that
Title: Re: value prompt java script?
Post by: bdbits on 26 Jun 2012 04:55:06 PM
I did not create a test case, but I believe it would be: VPT.options[VPT.selectedIndex].value
Title: Re: value prompt java script?
Post by: everlearner on 27 Jun 2012 07:30:34 AM
thanks this helped me