Hello - Please see the test script below. For some reason test 1 and test 2 don't recognize the selected subject as "Return/Cancellation" but test 3 works successfully:
var selectedVal = crmForm.all.subjectid.DataValue[0].name; //test 1 = false alert('is return/cancel = ' + selectedVal == 'Return/Cancellation');
//test 2 = false alert('is return/cancel upper = ' + selectedVal.toUpperCase() == 'RETURN/CANCELLATION');
//test 3 works var selectedSubjectValue = crmForm.all.subjectid.DataValue[0].name; if (selectedSubjectValue.toUpperCase() == "RETURN/CANCELLATION") { alert ('final test works'); }
My question is why does test 1 and test 2 not recognize the selected value but test 3 works successfully?
Theoretically, shouldn't all 3 test results eval to true?