I have a CRM 2011 form that contains a "Two Option" radio button field.
I have the following JavaScript function set to execute On Form Load:
function LockFormOnMailed(){
var ismailed = Xrm.Page.getAttribute("new_mailed").getValue();
alert(ismailed);
if (ismailed == true)
{
do some stuff
}
else
{
return;
}
}
What is unexpected is that when that function runs, the alert shows the value of false but the function executes all the "do some stuff" as if the condition were really true.
Do I not understand how the if/else comparison works with the "Two Option" field in CRM 2011?
I only want the "do some stuff" line to execute if the value is true, not false.
My problem is, it executes regardless of whether the value of the ismailed variable is true or false.
What am I doing wrong?
Any help would be greatly appreciated.
