I am trying to get data from lookup using the control class and its working fine when I do it in console but once the form is published and I try to open it up in Crome it will throw an error saying "Cannot read property 'textContent' of undefined".
Again if I use "NWF$(".CSclass option:selected").textContent" after inspecting the element it works fine.
Any ideas why it happens with certain controls.
var data =NWF$(".CSclass option:selected").textContent;
It will now show the alert because it couldn't get the data in data variable.
Maybe try to do it the other way:
Thanks for the explanation Tomasz, I get it now. Its just everytime when I need to debug a .js file I need to inspect the element on the form and the triggering function is working great!
Possibly attempt to do it the other way:
Make a capacity that is endeavoring to get that esteem. Be that as it may, encompass that content with the attempt get square.
Make an interim capacity (https://www.welookups.com/js/js_timing.html), that is activated by the NWF.FormFiller.Events.RegisterAfterReady activity that will trigger, inside that interim, your content that is getting the esteem.
On the off chance that a blunder is catched basically end the capacity, so it will be activated again by the interim capacity.
In the event that no mistake is catched clear interim variable and thusly end the circle.