Control to auto-increment a value in Nintex Forms

  • 12 October 2019
  • 3 replies
  • 26 views

Badge +3

Is there a way of creating a button control or some different control in Nintex Forms, which can increment a variable, say var1, every time I click on this button. I would like to use this button as anincrement counter.


3 replies

Userlevel 6
Badge +22

Hi,

 

The only way I know how to do this would be with a classic form and Javascript.

function increase(){
var num = NWF$("#" + count).val();
num++
NWF$('#'+ count).val(num); 
}

Sample classic form attached.

Badge +3

I am new to JavaScript.

1. Could you please explain me what does # mean in the code that you sent? 

2. Is NWF an object and Val is its attribute?

3. What does ''#'' + count equate to every time this code runs?

 Thank you.

Userlevel 6
Badge +22

1. Could you please explain me what does # mean in the code that you sent? 

A. Nintex Forms uses Jquery which is a write less do more library for Javascript 

Look at the Jquery documentation to answer this question. In short it’s part of the object selector syntax. 

 

2. Is NWF an object and Val is its attribute?

A. NWF$ is Nintex’s implementation of Jquery’s selector and .val is an attribute. 

 

3. What does ''#'' + count equate to every time this code runs?

A. See answer to questions 1&2. count is a reference to the control being targeted on the form. I gave the single lines of text control a Client ID of count. See the advanced section in the controls configuration to see this. 

Reply