I have a dropdown on my form, the contents are dynamicly populated when the form loads by:
function AddRecordsToOptionset(records) { var optionsetField = Xrm.Page.ui.controls.get("a_textmoduletest2"); for (var i = 0; i < records.length; i++) { optionsetField.addOption({ text: records[i].orb_name}); } }
Running the form I can see the optionset and dropdown retrieves the correct values and I can select one of them.
My problem is getting the selected option from the dropdown, it constantly returns null with everything I've tried:
var var_text = Xrm.Page.getAttribute("a_textmoduletest2").getText();
alert(var_text);
What is the correct way to get the text that the user has selected in Dynamics CRM 2011 via javascript?
regards,
Matt
*This post is locked for comments