COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: s.aravindkumar on 31 Jul 2017 06:52:06 AM

Title: from one input field to another input field??
Post by: s.aravindkumar on 31 Jul 2017 06:52:06 AM
Hi,

I created a prompt Page having a two text field and two input field and the report is working fine.

Now i got an requirement for the same report like when the end user press tab it needs to move from one input field to another input field but it should not go to the text field.

Is there anyway to do that

Thanks in Advance ,

Aravind Kumar Sekar
Title: Re: from one input field to another input field??
Post by: New_Guy on 31 Jul 2017 11:24:02 AM
Hi,
The tab key on the keyboard will pick the next field by default and we cannot control it. The below statement from you'it needs to move from one input field to another input field but it should not go to the text field', does this mean that you have another prompt in the prompt page. Need more explanation.

Good luck
New guy
Title: Re: from one input field to another input field??
Post by: s.aravindkumar on 31 Jul 2017 12:36:35 PM
Hi,

yes,I have two prompt.

It need to move from first date prompt to next prompt but its moving from first date prompt to "To Open Date".
Title: Re: from one input field to another input field??
Post by: New_Guy on 31 Jul 2017 03:33:18 PM
Hi,
Cannot change the tab behaviour as it is defined in the js files in cognos server or may be there is a way to override them by using java script. The other way is to place the, To Open date prompt above the, from date prompt. And user can use tab to go to the next prompt or shift tab to go to the To Open date.
And what is the reason for not using the tab key twice.
Good luck
New guy
Title: Re: from one input field to another input field??
Post by: CognosPaul on 31 Jul 2017 05:36:19 PM
This is one of those times where it's not worth fighting with the client.

Assuming you're on Cognos 10 the JavaScript is:
<script>
var paulScripts = {}
  , oCR = cognos.Report.getReport("THIS")
  , gateway = window['oCV'+'_THIS_'].getRV().getCV().sGateway;

// UTILITY FUNCTIONS
/*
* function Scripts.getControl
* Simply returns the prompt control.
*/
paulScripts.getControl = function(promptName)   {
    return oCR.prompt.getControlByName(promptName);
  };


document.getElementById('PRMT_TB_'+paulScripts.getControl('prompt1')._id_).tabIndex=1
document.getElementById('PRMT_TB_'+paulScripts.getControl('prompt2')._id_).tabIndex=2

</script>


replacing prompt1 and prompt2 with the names of the prompts.