• Resolved pexel

    (@pexel)


    Hi;

    1. if (fieldname26 === “A” && fieldname27 === “X”) { it works.
    2. else if (fieldname26 === “A” && fieldname27 === “Y”) { it works.
    3. if (fieldname26 === “B” && fieldname27 === “X”) { not working.

    Criterion 3 does not work. What could be the problem?

    (function() {
        var kriter4 = '';
        var kriter4A = '';
        if (fieldname26 === "A" && fieldname27 === "X") {
            if (DATEOBJ(fieldname15).getTime() >= DATEOBJ('01/01/0001').getTime() && DATEOBJ(fieldname15).getTime() <= DATEOBJ('08/09/1976').getTime()) {
                kriter4 = '0';
                kriter4A = '5000';
            } else if (DATEOBJ(fieldname15).getTime() >= DATEOBJ('09/09/1976').getTime() && DATEOBJ(fieldname15).getTime() <= DATEOBJ('23/05/1979').getTime()) {
                kriter4 = '44';
                kriter4A = '5000';
            }
        } else if (fieldname26 === "A" && fieldname27 === "Y") {
            if (DATEOBJ(fieldname15).getTime() >= DATEOBJ('01/01/0001').getTime() && DATEOBJ(fieldname15).getTime() <= DATEOBJ('04/01/1981').getTime()) {
                kriter4 = '0';
                kriter4A = '5000';
            } else if (DATEOBJ(fieldname15).getTime() >= DATEOBJ('01/04/1981').getTime() && DATEOBJ(fieldname15).getTime() <= DATEOBJ('08/09/1981').getTime()) {
                kriter4 = '38';
                kriter4A = '5000';
            } 
        } 
    		if (fieldname26 === "B" && fieldname27 === "X") {
            if (DATEOBJ(fieldname15).getTime() >= DATEOBJ('09/09/1999').getTime() && DATEOBJ(fieldname15).getTime() <= DATEOBJ('31/12/2035').getTime()) {
                kriter4 = '60';
                kriter4A = '9000';
            } else if (DATEOBJ(fieldname15).getTime() >= DATEOBJ('01/01/2036').getTime() && DATEOBJ(fieldname15).getTime() <= DATEOBJ('31/12/2037').getTime()) {
                kriter4 = '61';
                kriter4A = '9000';
            } 
        }
      jQuery('#calculation-kriter4').html(kriter4);
      jQuery('.kriter4-aciklama').html('Ya? ?art? : ');
      jQuery('.kriter4-sonuc').html(kriter4+' ya?');
    
      return kriter4;
    })();
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @pexel,

    The form structure is correct, but I don’t know if the conditions are satisfied. You should check the values of the fields used in the conditional statements.

    You should check if any of the conditional statements below are satisfied:

    if (DATEOBJ(fieldname15).getTime() >= DATEOBJ('09/09/1999').getTime() && DATEOBJ(fieldname15).getTime() <= DATEOBJ('31/12/2035').getTime())

    or

    if (DATEOBJ(fieldname15).getTime() >= DATEOBJ('01/01/2036').getTime() && DATEOBJ(fieldname15).getTime() <= DATEOBJ('31/12/2037').getTime())

    Best regards.

    Thread Starter pexel

    (@pexel)

    Everything is correct, there is no error in the code, but
    It works when I select fieldname26 A and fieldname27 X or Y.

    But when I make fieldname26 B and select fieldname27 X or Y
    The criterion I gave does not work.

    • This reply was modified 9 months, 1 week ago by pexel.
    Plugin Author codepeople

    (@codepeople)

    Hello @pexel

    You are comparing with fieldname27 value X, not A or B. Please check the code you provided.

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Criterion Problem’ is closed to new replies.