COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: tven77 on 12 Apr 2010 09:22:08 PM

Title: Javascript for data entry validation in prompt
Post by: tven77 on 12 Apr 2010 09:22:08 PM
Hi,
Need your help guys.  Do any of you have a sample javascript that validates the value in a prompt and after clicking the finish button, it will display an error message "value should not be blanks" if the prompt has no value?

regards,
tven
Title: Re: Javascript for data entry validation in prompt
Post by: Sreeni P on 14 Apr 2010 04:09:59 AM
<script language="javascript">
if(document.getElementById('formWarpRequestRS')._oLstChoicesXXX.options[0]==" ")
{
alert("value should not be blanks")
}
</script>


Or

<script language="javascript">
if(document.getElementById('formWarpRequestRS')._oLstChoicesXXX.value ==" ")
{
alert("value should not be blanks")
}
</script>


where XXX is the name of the prompt.
Title: Re: Javascript for data entry validation in prompt
Post by: tven77 on 27 May 2010 12:42:25 AM
Hi,
Thanks for the reply,but where should i put the html item containing this code? Should it be beside the prompt being validated or the finish prompt button?

Thanks in advance.

Regards,
tven
Title: Re: Javascript for data entry validation in prompt
Post by: Sreeni P on 27 May 2010 01:32:44 AM
yeah , u can do eithr...the html item wil check in the layout whaich objects has been embided with this,
better place the HTML item after the prompt button