4 Replies Latest reply on Nov 22, 2012 2:29 AM by Mandeep5062

    stuck in an "if statements conflict"

    pixelfetischist

      Dear List,

       

      I am having problems getting my scripts to work:

       

      This line of code works perfectly well:

      if (this.getField("Button1").value == "Yes")

      {

      this.getField("Field1").value = Array1[x][y];

      }

       

      This same code with a second if-statement however doesn't work anymore ("missing ) after argument list"-Error):

      if (this.getField("Button1").value == "Yes")

      {

      this.getField("Field1").value = Array1[x][y];

      }

       

      if (this.getField("Button2").value == "Yes")

      {

      this.getField("Field2").value = Array2[x][y];

      }

       

      Does anybody have any idea? Am I misspelling the JS syntax?

       

      Thanks a million,

      Ralf

        • 1. Re: stuck in an "if statements conflict"
          try67 MVP & Adobe Community Professional

          The code you posted seems fine. The problem is proabably in the code you didn't post... Usually the error message includes a line number, which should help you find out where the problem is.

          • 2. Re: stuck in an "if statements conflict"
            pixelfetischist Level 1

            Here is the entire function. The reported error points to the last line of the code, which is the curly bracket to end the function:

             

            function getTarife()

            {

            Mitarbeiter = getMitarbeiter(this.getField("Anzahl_M").value);

            Selbstbeteiligung = getSBPaketDeckungen();

             

            KPRS = new Array();

            KPRS[0] = new Array(911.27, 1197.80, 1573.72, 2154.32, 2891.08, 3082.83, 3806.66, 4500.35, 5274.82, 5698.14);

            KPRS[1] = new Array(638.76, 784.17, 1044.84, 1375.52, 1942.12, 2516.23, 2977.25, 3677.40, 4145.97, 4546.67);

            KPRS[2] = new Array(565.51, 743.24, 978.05, 1337.83, 1795.61, 2209.24, 2727.35, 3225, 3779.74, 4083.49);

            KPRS[3] = new Array(608.99, 759.01, 999.01, 1350, 1870, 2370, 2869.99, 3480, 3999.99, 4350);

             

            KRS = new Array();

            KRS[0] = new Array(790.21, 888.46, 1166.10, 1508.16, 1971, 2505.36, 3078.62, 3550.20, 4050.41, 4598.32);

            KRS[1] = new Array(518.04, 577.19, 750.34, 967.66, 1383.26, 1754.03, 2152.03, 2477.59, 2820.33, 3197.28);

            KRS[2] = new Array(471.19, 530.72, 692.07, 893.17, 1244.15, 1575.43, 1938.68, 2227.37, 2534.87, 2872.46);

            KRS[3] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0);

             

            KRSS = new Array();

            KRSS[0] = new Array(699.07, 782.01, 1043.75, 1358.84, 1802.45, 2326.65, 2841.64, 3326.87, 3833.64, 4386.59);

            KRSS[1] = new Array(419.44, 469.21, 626.25, 815.30, 1216.66, 1570.49, 1918.11, 2245.64, 2587.71, 2960.95);

            KRSS[2] = new Array(384.49, 430.11, 574.06, 747.36, 1081.47, 1395.99, 1704.98, 1996.12, 2300.17, 2631.95);

            KRSS[3] = new Array(405, 449, 605, 779, 1150, 1500, 1820, 2150, 2450, 2800);

             

            USRS = new Array();

            USRS[0] = new Array(161.05, 184.65, 226.72, 285.20, 348.79, 411.37, 521.14, 556.02, 600.13, 650.39);

            USRS[1] = new Array(140.54, 154.90, 186.71, 233.89, 288.27, 340.59, 425.73, 456.51, 491.39, 532.42);

            USRS[2] = new Array(125.15, 143.62, 175.42, 220.55, 270.83, 319.04, 404.20, 430.86, 464.72, 503.70);

            USRS[3] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0);

             

            if (this.getField("KompaktRS").value == "Ja"){this.getField("KompaktPlus-RS").value = KPRS[Selbstbeteiligung][Mitarbeiter];}

            if (this.getField("KompaktRS").value == "Ja"){this.getField("KompaktPlus-RS").value = KPRS[Selbstbeteiligung][Mitarbeiter];}

            }

            • 3. Re: stuck in an "if statements conflict"
              try67 MVP & Adobe Community Professional

              That code is fine.

               

              On Wed, Nov 21, 2012 at 2:12 PM, pixelfetischist

              • 4. Re: stuck in an "if statements conflict"
                Mandeep5062 Employee Moderator

                Code Seems Fine.

                Please Check in JS Debugger what is the error you're facing .

                Post the Error here and we'll help you.