RAHULGANDHI
Forms Fledgling

Control to auto-increment a value in Nintex Forms

Jump to solution

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.

0 Kudos
Reply
3 Replies
SimonMuntz
Nintex Employee
Nintex Employee

Re: Control to auto-increment a value in Nintex Forms

Jump to solution

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.

View solution in original post

0 Kudos
Reply
RAHULGANDHI
Forms Fledgling

Re: Control to auto-increment a value in Nintex Forms

Jump to solution

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.

0 Kudos
Reply
SimonMuntz
Nintex Employee
Nintex Employee

Re: Control to auto-increment a value in Nintex Forms

Jump to solution

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. 

0 Kudos
Reply