I am pretty new to JavaScript, and looking for some nesting help. I can get some IF - ELSE cases to work correctly individually, but when I try to nest it with other ones I am running into some problems. I am trying to look up a condition, but then nest another condition for a language inside of it.
if ( data.Page1.Type.rawValue == 'P' )
{
if ( data.ZWPRINTLANG.rawValue == 'EN' )
{
this.rawValue = "Scope";
}
else if (
data.ZWPRINTLANG.rawValue == 'DE' )
{
this.rawValue = "Umfang";
}
}
if (
data.Page1.Type.rawValue == '1' )
{
if ( data.ZWPRINTLANG.rawValue == 'EN' )
{
this.rawValue = "Approval";
}
else if (
data.ZWPRINTLANG.rawValue == 'DE' )
{
this.rawValue = "Anerk";
}
}
// This was another attempt to make an else case
if ( data.Page1.TF_One.ZART.rawValue != 'P' | '1'
)
{
if (
data.ZWPRINTLANG.rawValue == 'EN' )
{
this.rawValue = "Approval";
}
else
{
this.rawValue = "Anerk";
}
}
The syntax check is usually correct, but I will only get one set of values to display no matter what selection I am under. Does anyone have some ideas of what I am doing wrong, or how I could correct this?
Thanks,