cancel
Showing results for 
Search instead for 
Did you mean: 
naccarati
Nintex Newbie

Connect jquery file to Nintex form

Hello,

We cannot use InfoPath in SP 2013 on premise.  So, we use the out of the box form and do all of our functions and presaveactions in jquery.  We load the jquery file from a content editor web part to the .js file in our Site Assets library.

Question:  Can we do this the same way with a Nintex form or is there some other method?  I'd prefer to not have to put jquery in on a per field basis if possible.

Thanks for your help.

Labels: (1)
Tags (1)
0 Kudos
Reply
4 Replies
SimonMuntz
Nintex Employee
Nintex Employee

Re: Connect jquery file to Nintex form

Hi,
Only a Classic Nintex form allows for custom JavaScript to be added.
In the Nintex form designer navigate to Settings from the ribbon and expand the Advanced section.
You can link to your .js files by adding the path in the "Custom JavaScript Includes" section.
0 Kudos
Reply
MegaJerk
Automation Master
Automation Master

Re: Connect jquery file to Nintex form

To expand on what Simon said, there is actually no need to import jQuery into Nintex Forms Classic as it's already packaged in. 

Instead of calling it with the $ variable, you will need to use NWF$ instead 

 

/* If I wanted to create a jQuery Object of all the elements with the class "myClass" */

NWF$(".myClass"); 

0 Kudos
Reply
naccarati
Nintex Newbie

Re: Connect jquery file to Nintex form

Using the out of the box form, we have one jquery file for newform.aspx and one for editform.aspx.  Is this not necessary when connecting to a Nintex form?  Also, it appears we have to rename everything to the "nf" version, etc.  Correct?  Thanks for your help.

0 Kudos
Reply
MegaJerk
Automation Master
Automation Master

Re: Connect jquery file to Nintex form

For a Nintex Form (in Classic Mode), if you have custom code that you'd like to use with the form, you can drop it into either the Custom Javascript area in the Form Settings: 

image.png

 

Or you can expand the Advanced menu and use a URL to point directly to a JavaScript file somewhere: 

image.png

 

 

If you have that pre-made JavaScript already sitting around, and it uses Jquery, you'll need to convert every call to jquery that uses the "$" variable so that it reads "NWF$" instead, or add something along the lines of: 

var $ = $ || NWF$;

to the top of the file / code, which would allow you to maybe get away with not changing every single instance of the $ variable. 

I hope that this helps. 

Reply