how to set value to calculated control

  • 8 September 2016
  • 6 replies
  • 2 views

Badge +10

Hi

How to set value to a Calculated control using javascript

I have tried this NWF$('#'+ jvartxt).val ('Something');

Any help?


6 replies

Userlevel 5
Badge +14

why would you want to set it from javascript

calc control calculates value on its own...

Badge +10

i was calling a function in calc control, but it calls the function before even loading the controls. I using a another control value in the function which is returning null. The calc control is displaying a message based on some conditions

Userlevel 5
Badge +14

what's the type of control the calc value control depends on?

if it is list lookup control you might have problem to achieve what you need since it is populated asynchronously and there is no apparent event that would be fired once the control is populated.

but in general, you can ensure that calc value control is reevaluated once a value in dependent control changes by making calc control formula dependent on that control, like

myFunction(reference_to_control_it_depends_on)

Badge +10

Hi Marian,

It is using a lookup control in the function.

But tried passing the lookup control text value to the function and it seems it is working. No idea how. I used the alert in the function and it shows the lookup control text. It works on load also

Userlevel 5
Badge +14

glad you got it working.

just for my curiosity, what forms version are you on?

Badge +10

192018_pastedImage_1.png

Reply