Skip to main content
Nintex Community Menu Bar

scrolling to the first error after submit

  • May 28, 2018
  • 3 replies
  • 50 views

Forum|alt.badge.img+4

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)

3 replies

Forum|alt.badge.img+14
  • Scholar
  • May 28, 2018

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


Forum|alt.badge.img+4
  • Author
  • May 29, 2018

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


Forum|alt.badge.img+14
  • Scholar
  • May 29, 2018

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-nintex-responsive-forms?…