COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Prakash Bhai on 19 Aug 2010 07:27:03 AM

Title: Text Box Prompt
Post by: Prakash Bhai on 19 Aug 2010 07:27:03 AM
Hi Everyone,

I am working on Text box prompt in a report page. I am using Java Script<HTML ITEM> based on user requirement. When I run the report, Initially Text box has to be empty and alert msg should be :pls enter number". And When I enter a value which is more than 6 digits,It has to throw an err msg saying" you have crossed the limit size".

How to implement this functionality using HTML ,If there is any other alternative that would be great.

Please respond ASAP


Title: Re: Text Box Prompt
Post by: Sreeni P on 19 Aug 2010 08:46:33 AM
Quote from: Abhi Ram on 19 Aug 2010 07:27:03 AM
Hi Everyone,

I am working on Text box prompt in a report page. I am using Java Script<HTML ITEM> based on user requirement. When I run the report, Initially Text box has to be empty and alert msg should be :pls enter number". And When I enter a value which is more than 6 digits,It has to throw an err msg saying" you have crossed the limit size".

How to implement this functionality using HTML ,If there is any other alternative that would be great.

Please respond ASAP




Hi U can try this
<script>
var fW=(typeof getFormWarpRequest == "function" ?
getFormWarpRequest() :document.forms["formWarpRequest"]);
{
str=fW._textEditBox<your promptname>.value;

if (str==null||str=='')
{
alert("your text goes here.");
}
else if(str.length(str>=6))
{
alert('Your text Goes here')
}
else
alert('Your text goes here')
}
</script>


try once ....hope it will fixes ur problem
Title: Re: Text Box Prompt
Post by: Prakash Bhai on 20 Aug 2010 04:40:46 AM
Hi Srinivas,
Thanks for the help. What I did from my side is, In the main report page, I took a text box prompt with Parameter1 as name. And in the Miscellaneous(Properties Pane) I named the text box name as Parameter1.
And next to text box prompt, I have pulled HTML item and  in the Description(Properties Pane) I have named it as function. And In HTML I just wrote this code

<script>
var fW=(typeof getFormWarpRequest == "function" ?
getFormWarpRequest() :document.forms["formWarpRequest"]);
{
str=fW._textEditBoxParameter1.value;

if (str==null||str=='')
{
alert("your text goes here.");
}
else if(str.length(str>=6))
{
alert('Your text Goes here');
}
else
alert('Your text goes here');
}
</script>

But I found some errors when I executed the report. Can u pls tell me where I went wrong.