AnsweredAssumed Answered

Nintex Forms and Javascript - Calculated field

Question asked by leif.frederiksen on Apr 29, 2016
Latest reply on Apr 4, 2017 by chaitra.b.c

Hi,

 

I have a problem that is driving me crazy.

 

The scenario is, that I have a calculated field, that I want to do something with in Javascript when the form loads.

 

So I have some Javascript like this:

 

NWF$(document).ready(function(){

     var element = NWF$("#" + varCalculatedField);

     element.change(function() {

       console.log("element changed - value is " + element.val());

    });

});

 

For a more "normal" control than the calculated field, this would result in the message being written to the console.

 

However, for the calculated field, the ".change" event never fires, so I do not get my message.

 

I tried to catch it another way (very bad, but just to see it work). I basically just wait half a second from the ".ready" event on the form itself, and then run my business logic (writing to console...). This works, but of course is not a very good way to do it.

 

NWF$(document).ready(function(){

     var element = NWF$("#" + varCalculatedField);

     setTimeout(function() {

         console.log("element value is " + element.val());

     },500);

});

 

Question: What event should i listen to and respond to to make this really work?

 

Regards

Leif

Outcomes