Here is what I have been trying so far to no avail:
LFForm.onFieldChange(function() { var d = LFForm.getFieldValues({fieldId: 175}); var monthTxt = d.options[d.selectedIndex].text; console.log(monthTxt); }, {fieldId: 175});
I found the d.options[d.selectedIndex].text on Stack Overflow, but I am unsure how much 'normal' javaScript is compatible wit the LFForm object. EDIT: as long as you are not traversing the DOM, the LFForm object works.
Has anyone found a way to get the selected text from a drop down? My 'plan b' is to use nested ifs defining the value where '01' = 'January', etc.. But getting a selected value seems like a fundamental thing the javaScript should be able to do. Thus the question...
Use case: I am converting from classic designer and I need both the value and the text from a drop down. It is a month dropdown where the value is a number and the drop down is the text. I have 130 lines of jQuery that are essential to the form. I am converting because unfortunately, when users add 30+ collection lines the entire form slows down to 10 second wait times every time a user clicks something. I tested in modern designer and the speed is significantly better. There is still some lag after 30+ lines but it is usable.
Much thanks in advance folks :)