Custom JavaScript functions in Nintex Forms

  • 20 November 2018
  • 10 replies
  • 70 views

Badge +1

Hello Nintex community,

I have a JavaScript function that fires based off a change using an .on "change" function. I'd much rather us the .on "onmouseout" function, but for some reason, it doesn't work. Basically, Im doing a check on rather a user has entered text into a input field...so far the user would have to click anywhere on the form for the code to fire, or tab. i'd much rather, once the user has finished typing and the cursor leaves that text input, that the function below will fire.

Here is my working code below: 

NWF$(".nf-outer").on("change", ".cssDescriptionLine", function () {
   var $row = NWF$(this).parents('.nf-repeater-row').first();

   var description = $row.find(".cssDescriptionLine input");

   var descriptionValue = description.val();

   if (descriptionValue !== '') {

      NWF$("input[value$='Save']").attr('disabled', false);

   }
   else if (descriptionValue === '') {

      NWF$("input[value$='Save']").attr('disabled', true);
   }

});

I'd prefer this instead: NWF$(".nf-outer").on("onmouseout", ".cssDescriptionLine", function ()

Any ideas on how I could achieve this? Is there a list of working JavaScript functions that work and don't work? Im guess on form events work within nintex forms...and not mouse events.

Thank you!


10 replies

Userlevel 5
Badge +13

HI Timothy Wright‌,


While Nintex does allow the addition of custom JavaScript, we do not support or suggest custom JavaScript. Hopefully, someone else in the community may be able to help.


Cheers,

Euan

Badge +1

Thanks for your response. After doing some testing, I have concluded that, in general, Nintex forms do not support JavaScript mouse events, which is fine. It does, however support form events( which i guess makes sense due to the nature of it being a nintex form happy.png). 

To make sure our form works well with both desktop and Mobile environments( sense I know mobile has issues rendering/handling JavaScript), I will do more testing with the built in functions in Nintex to achieve some of the same goals...

But, is there a dedicated link to tutorials/How-to's, to write custom(non JavaScript) Nintex functions? I've played around with some and have gotten them to work, but I feel development would be a lot simpler if I had a reference to learn from. If these references do exist please forgive me, as I have not seen much documentation on them other than examples of what other users have done in the forums.

Thanks a lot for your assistance! 

Userlevel 5
Badge +14

while there are scenarios when javascript is needed and only possible way to get something done, I think in your scenario it's not needed at all.

you can achieve the same with simple rule:

- assign a new formatting rule to 'Save'button (or better: add a panel on the form, move Save button into it and assign new rule to the panel)

- set rule's formula to like 

IsNullOrEmpty(DescriptionLineNamedControl)

- set rule's action to 'Disable'

Userlevel 2
Badge +11

Hi Euan Gamble,

Although I respect your/Nintex's point of view, daily requirements tell a different story; I do agree when it comes to portability where customizations may add to the (migration) complexity. However, we wouldn't need to if some basic functionalities most of us were used to in InfoPath would be available in (on-Prem) Nintex Forms. The most essential one to set fields based on a control change or other formula outcome.

NB: I still like Nintex as an ex-InfoPath user wink.png

Badge +2

From what I gathered if you're using the responsive version you can't make any HTML/CSS/JS edits. Which is kin of a bummer. 

I could really use Javascript to alter some aspects of the flow I've found or places where I would like to alter some styling but I found in the forums/user suggestions that Nintex believes you can do anything you want to with their GUI setup.

Userlevel 5
Badge +13

Hi Jean-Pierre Huls‌,

I have created a video showing off the new rules engine in Universal Forms.

Example of Universal Forms Rules - YouTube 

Hopefully, this shows you where we are heading with our new technology.

Cheers,

Euan

Userlevel 5
Badge +13

Michael Burns‌,

Please do list the changes you would like to see in responsive forms as we are currently rebuilding our responsive forms engine from the ground up.

The styling engine we currently have is far from the final product.

Cheers,

Euan

Userlevel 2
Badge +11

Thank you Euan Gamble,

That's indeed something to look forward. Any idea when it becomes available in Nntex Forms 2016 on-prem?

Best regards,

Jean-Pierre

Userlevel 5
Badge +13

hi Jean-Pierre Huls‌,

We are focusing on getting Universal Forms ready for Office 365 first and expecting a release in the first quarter of 2019. Once this ships, we will be focusing on releasing Universal Forms for SharePoint 2013, 2016 and 2019.

Cheers,

Euan

Userlevel 2
Badge +11

Thank Euan Gamble,

I'll be looking forward to the on-Prem release.

Best regards,

Jean-Pierre

Reply