I have a lookup column with more than 20 items and I want to retrieve the selected text in a variable.To achieve this I have tried the code below but I am getting an error(mentioned in the code).
Note : When i use an alert, it is showing the correct value.
$("[title='Unit']").blur(function()
{
var sys = null;
var unit = null;
if(getField("select","Unit"))
{
sys = $("[title='Unit'] option:selected").text();
unit = sys;
sys += ' - ' + $("[title='System'] option:selected").text();
}
else if(getField("input","Unit"))
{
sys = getField("input","Unit");
var opt=document.getElementById(sys.opt);
**sys = opt.options[opt.selectedIndex].text;** // throws error Object does not support this action
unit = sys;
sys += ' - ' + $("[title='System'] option:selected").text();
}
});