little javascript code
Can someone help me with some javascript I'm having a hard time with? Below is the section I'm having a problem with. The PNR_BOM_Change_Only is a yes/no drop down, but the values are 0 and 1. The CN_Entry_Initials and Release_Status_Initials are drop downs that have a few options in them to choose from. The CN_Entry_Initials has a Null Value, C, or an N option. The Release_Status_Initials has only a U and N option. I'm trying to get this javascript to display an alert box if the PNR_BOM_Change_Only is a 1 and the CN_Entry_Initials is not equal to a C, and the Release_Status_Initials is not equal to an N. This alert box works if the PNR_BOM_Change_Only is a 1 and if I choose an N in the CN_Entry_Initials drop down and the Release_Status_Initials is a U, but it does not work if I choose an N in the CN_Entry_Initials drop down and the Release_Status_Initials is an N. This ends up processing through and it shouldn't yet because the CN_Entry_Initials is not a C. If I remove either the CN_Entry_Initials or the Release_Status_Initials code and keep the PNR_BOM_Change_Only code, this does work just fine then. What am I doing wrong?
else if(document.AddECNumber.PNR_BOM_Change_Only.value == "1" && document.AddECNumber.CN_Entry_Initials.value != "C" && document.AddECNumber.Release_Status_Initials.value != "N") { //this will return true if the input passes the regular expression
alert("ECO type required - Select (C)hange for eco line item and Select N for Release Status if PNR/BOM Change Only is yes");
}
Andy
