Skip to main content

Hi

How to set value to a Calculated control using javascript

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

Any help?

why would you want to set it from javascript

calc control calculates value on its own...


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


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)


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


glad you got it working.

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


192018_pastedImage_1.png


Reply