cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

scrolling to the first error after submit

I want to scroll to the first error after submit.

The position is: NWF$(".nf-validator-error:visible").first().offset().top

The problem is that I can't add listener to the submit button. 

I can't do like this:

NWF$("input[type=submit][value=send]").click(function(){})

So...

1. Is there OOTB solution?

2. if not - how may I add event listener to an submit button (responive file)

0 Kudos
Reply
3 Replies
Workflow Hero

Re: scrolling to the first error after submit

responsive forms do not support any custom javascript code.

and unfortunately there is any OOTB functionality that would automatically navigate to the first invalidated control

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: scrolling to the first error after submit

It supports code by adding a richtext with "<script src=''>" can.

I have used a code that make this in that way

NWF$(document).ready(function () {
NWF.FormFiller.Events.RegisterAfterReady(function (){
NWF$("input[type=submit][value=שליחה], input[type=submit][value=שמירה]").click(function(){
var stepIn = NWF$(".nf-validator-error:visible").first().parents("div[data-controlname=לוח]").attr("id");
document.getElementById(stepIn).scrollIntoView();
})
})

})

using a function that add "id" to every panel

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: scrolling to the first error after submit

it's just a hack.

even it works, it doesn't mean it's supported. it works in current release(s), but need not in future ones.

see official warning from NINTEX representative

https://community.nintex.com/message/78428-re-unable-to-find-the-custom-javascript-text-area-in-nint... 

0 Kudos
Accept as Solution Reply