COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Topic started by: Desperado on 04 Feb 2009 10:04:43 AM

Title: how to fetch textbox prompt value into a parameter when using java script
Post by: Desperado on 04 Feb 2009 10:04:43 AM
Hi,


My requirement is that i have two textbox prompts and i have to give an option to the user that he has to enter atleast one value. We don't know which value he enters. so, I'm trying to inplement a javascript in which it validates both the prompts and check the values in them. if there is no value, then it will no go into the report page.

Everything seems to work okay.. but i got a problem in fectching the value in the textbox prompt into the parameter.

Attahced is my script for the same.

My logic to fetch the value is

par1 = document.formWarpRequest.elements["p_provider_id"].value


i think there is a mistake in this syntax.

Please correct it.

Thanks in Advance
Title: Re: how to fetch textbox prompt value into a parameter when using java script
Post by: Gopinath on 10 Feb 2009 06:42:14 AM
Hope you solved this long back. Still posting it coz, it might help others.

par1 = getFormWarpRequest()._textEditBoxp_provider_id.value;
Title: Re: how to fetch textbox prompt value into a parameter when using java script
Post by: Desperado on 11 Feb 2009 10:08:54 AM
Gopi,

Thanks alot for the help. i didn't get any solution for this till today.
I modified the one that you sent to
par1 = document.formWarpRequest._textEditBoxp_provider_id.value;
and it worked.

Thank you
Title: Re: how to fetch textbox prompt value into a parameter when using java script
Post by: goose on 18 Feb 2009 01:39:50 AM
Desperado you must bear in mind that when you upgrade to 8.4 your JavaScript will have to change. Your best bet is package all your JavaScript utility functions into a library and include them in every page via the standard <script> html tag. Then when Cognos changes their JS implementation you only have to update your library once, and not go through every report and update it.

Of course this wont be an issue of it just one report.

Title: Re: how to fetch textbox prompt value into a parameter when using java script
Post by: sri44 on 19 Feb 2010 04:40:20 PM
Is there any way to grab parameter value using Java script 

i know we can access paramater in page by p_<ParameterName>

I don't how to grab the value  and check condition in the script based parameter value