Skip to main content
Nintex Community Menu Bar
Solved

Set value of Yes or No checkbox from the result of calculated value of true or false

  • October 30, 2025
  • 5 replies
  • 42 views

Forum|alt.badge.img+4

Hi,

Trying to setup a Classic Nintex form that have Yes/No control that I want to set automatically based on the result of my calculated value of true or false. It mean when the result of my calculated value is “True” it will put check mark on the Yes/No box. Is this possible? I see some java script available that can do it but for some reason it is not working.

Here is my code:

NWF.FormFiller.Events.RegisterAfterReady(function () {var calculatedValueControl = NWF$('#' + MyCVID);calculatedValueControl.on('change', function () {var calculatedResult = NWF.RuntimeFunctions.Get  CalculatedValue(MyCVID);var yesNoControl = NWF$('#' + MyYesNoID);if (calculatedResult === true || calculatedResult === 'Yes') {yesNoControl.prop('checked', true);} else {yesNoControl.prop('checked', false);}});

 

Greatly appreciated any help.

Thank you.

Best answer by SimonMuntz

Hi ​@aorellano,

You also need to assign a Client ID JavaScript variable name to the checkbox.
Please see my example form attached. 
 

 

5 replies

SimonMuntz
Nintex Employee
Forum|alt.badge.img+23
  • Nintex Employee
  • October 30, 2025

Hi,

The following code should do the job.
It will check the box based on a true or false value from a calculated value control.
This happens on form load and then on value change.

 

NWF.FormFiller.Events.RegisterAfterReady(function () {

    function syncCheckbox() {
        var val = NWF$("#" + MyCVID).val();
        if (val === "true") {
            NWF$("#" + yesNoControl).prop("checked", true);
        } else {
            NWF$("#" + yesNoControl).prop("checked", false);
        }
    }

    syncCheckbox();

    NWF$("#" + MyCVID).change(function () {
        syncCheckbox();
    });
});

 


Forum|alt.badge.img+4
  • Author
  • Rookie
  • October 31, 2025

Hi SImon,

Thank you for your response. 

Just want to clarify on where I can put the Yes/No control in the code? I see you have for the Calculated Value which is the “MyCVID”, how about a reference to the yes/no control field?

 

Much appreciated.


Forum|alt.badge.img+4
  • Author
  • Rookie
  • October 31, 2025

I tried to code but it is not working, please see result screenshot. The true that was circled was the result of my calculated value and for some reason the Initial Freight checkbox was not mark.

 


SimonMuntz
Nintex Employee
Forum|alt.badge.img+23
  • Nintex Employee
  • Answer
  • November 1, 2025

Hi ​@aorellano,

You also need to assign a Client ID JavaScript variable name to the checkbox.
Please see my example form attached. 
 

 


Forum|alt.badge.img+4
  • Author
  • Rookie
  • November 6, 2025

Hi Simon,

 

Thank you for the example code from the form you have provided, it actually works.

 

Much appreciated.