Skip to main content
Nintex Community Menu Bar
Question

Set Form Variable on Button Click

  • August 21, 2025
  • 2 replies
  • 44 views

Forum|alt.badge.img+1

I am attempting to set a form variable using JavaScript. When the form loads there is an error in the developer tools console log that one of the variables is not defined. 

 

NWF$(document).ready(function () {
NWF$('#' + varRequestorManager).click(function () {
NWF.FormFiller.SetValue("MyRequestorFormVariable","New Value");
var val = NWF.FormFiller.GetValue("MyRequestorFormVariable"); console.log("Form Variable Updated" + val);
});
});

 

2 replies

SimonMuntz
Nintex Employee
Forum|alt.badge.img+23
  • Nintex Employee
  • August 22, 2025

Hi ​@jw-gw-semi,

Welcome to the community.
I think the issue here is that you are trying to give the button a name via the CSS class, which does not work.
I suggest that you approach this by either putting all your code in the client click section of the button configuration or creating a function with your code and calling that function from the client click field.
 

 


Forum|alt.badge.img+1
  • Author
  • Rookie
  • August 22, 2025

Hi Simon,

    I am looking into creating a function for my code.

thanks,

jason