Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 55831

If/Else not working as expected when using if variable == true with "Two Option" control

$
0
0

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. 


Viewing all articles
Browse latest Browse all 55831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>