We have created a script which show the error message but when user hit enter it goes to next screen .It should not go to next screen unless user enter valid values.
Thanks in Advance.
Regards,
JP
Hi,
You may use an event to cancel the request that is processing.
You may attach an event called "onRequesting" to catch the event before sending the request.
ex.
private attachEvents(controller: IInstanceController): void {
this.detachRequesting = controller.Requesting.On((e) => {
this.onRequesting(e);
});
this.detachRequested = controller.Requested.On((e) => {
this.onRequested(e);
}
private onRequesting(args: CancelRequestEventArgs): void {
// Only validate for the enter key (next button).
if (args.commandType === "KEY" && args.commandValue === "ENTER") {
if (!this.validateFields()) {
args.cancel = true;
You just need to pass a true value to cancel the process so that it will not proceed to the next panel.
Reggie
You can always control the ENTER key.
However it's possible to skip that validation if You don't block the user key action when user access to screen of after a refresh (F5)...