COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Grayson_Basil on 25 Jul 2016 07:18:53 AM

Title: Date Prompt - Optional how to clear Date edit box with JS
Post by: Grayson_Basil on 25 Jul 2016 07:18:53 AM
Using 10.2.1,

I have a request to search invoice by date, but it could be optional.  Defaulting to 1900 is not an option since the user does not want this as I suggested this already.

How do I use an optional date prompt as an Edit box, how do I clear the date value - what other methods do you use for optional date

Title: Re: Date Prompt - Optional how to clear Date edit box with JS
Post by: ftgarcia0618 on 28 Jul 2016 01:54:08 PM
Hi Grayson,

To clear the date and override the default value add the script below to an HTML item and place it just after the date prompt. Replace the "###" with your prompt's name.

<script language="javascript">
document.formWarpRequest.elements["txtDate###"].value='';
</script>
<body oNLoad=init()>
<form name="formWarpRequest">