AnsweredAssumed Answered

Pains using JavaScript in Nintex Forms

Question asked by harryr on Nov 28, 2017
Latest reply on Dec 1, 2017 by nmarples

Hi All

 

I asked this question at the end of an answred thread ( https://community.nintex.com/message/73682-re-print-a-js-var-value-to-a-single-line-text-box-nintex-forms?commentID=7368… ) but I am having a lot of pains with incorporating JavaScript into Nintex forms. 

 

I have some form fields that are assigned variable names that start with nField...(Nintex field).

 

I have written a script that works in standard html/JS but refuses to work in Nintex Forms. I have a button that triggers the function from the script but the page just reloads/resets which so far, through testing, appears to be an indication that Nintex is not able to handle the JavaScript that is being called. 

 

There are some script specific variable used for storing values for a calculation in the script that are not in the form.

The idea is that the user inputs the information in the fields and then clicks a button to get a recommendation based on those choices. There are quite a few rules hat determine what recommendation they get. That recommendation is then shown in  a box at the end of the form.

 

There are no errors reported o the console. Just a page reload.

 

Can anyone suggest where I am going wrong here? Do I need to insert NWF$ all over the script and if so are there any guides or references of where to put them? I can't seem to find any. I have been trying various combinations but nothing works and it's getting very frustrating now. 

 

Can you even use standard JavaScript in Nintex forms?

 

Appreciate any help that can be provided.

 

The JS is configured here:

 

A button on the form calls the JS function:

Outcomes