AnsweredAssumed Answered

Nintex Forms 2010 Javascript/Jquery action stop working in if statement

Question asked by lukas.man on Nov 23, 2017
Latest reply on Nov 24, 2017 by lukas.man

Hello everyone,

 

I got my code working while testing one action at a time. At the end, when I combined everything, one of the actions stopped working for some reason...

 

Let me explain.

 

1) deselects all checked boxes within a checkbox:

NWF$('.g9dw input:checkbox').not(this).prop('checked', this.checked); -- and this line works alone

 

2) test script - works!

NWF$(document).ready(function() {
   var v1 = NWF$('#' + igchq + ' input:checked').val();
   var validated = true;

   alert(v1);
   if(v1 == "HQ"){
      alert('success');
   }
}) 

 

3) final script combined. I only include deselect checkbox line inside if statement. DOES'T WORK. and I cannot understand why...

NWF$(document).ready(function() {
   var v1 = NWF$('#' + igchq + ' input:checked').val();
   var validated = true;

   alert(v1);
   if(v1 == "HQ"){

      alert('success');
      NWF$('.g9dw input:checkbox').not(this).prop('checked', this.checked);
   }
}) 

Could any of you explain me why... ?


Thank you all in advance.

Outcomes