cancel
Showing results for 
Search instead for 
Did you mean: 
jmedina
Nintex Newbie

Set choice field value with two other choice fields

Jump to solution

Hello,

I am trying to set a choice field on a 2013 form using .js similar to this thread: How to set value in Choice field based on value of other choice field , but I need to be able to change the drop down with a separate field. Here is the example:

Basically, if the information is correct, and they click "Yes", the Approval column will select "Approved". If the information is not correct the Close site? will show. If they need to close the site and select "Yes" on the close site column, the Approval column will changed to "Closed Site". 

My Variables are set up as such:

Information Correct Column = varYesNo

Close Site? column = varClose

Approval column - varApproval

I can get one column to change the Approval column, but I have not been able to get them both to work.

Here is my code:

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

NWF$('#'+varYesNo).change(function(){

if (NWF$('#'+varYesNo).val

("Yes")){


NWF$('#'+varApproval)

.val ("Approved");

}

});


NWF$('#'+varClose).change(function(){

if
(NWF$('#'+varClose ).val
("Yes")) {

NWF$('#'+varApproval).val(‘Closed Site’);

)
});

});

The form just spins and won't let me preview when I add the NWF$('#'+varClose).change function.

Labels: (1)
0 Kudos
Reply
1 Reply
jmedina
Nintex Newbie

Re: Set choice field value with two other choice fields

Jump to solution

I figure this out. Here is the code:

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

   NWF$('#'+varClose).change(function(){

     if (NWF$('#'+varClose).val

("Yes")){

        NWF$('#'+varApproval)

.val ("Closed Site");

     }

   });

});

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

   NWF$('#'+varYesNo).change(function(){

     if (NWF$('#'+varYesNo).val

("Yes")){

        NWF$(''+varApproval)‌

.val ("Approved");

     }

   });

});
 

0 Kudos
Reply