locked
event handling, Relational operator RRS feed

  • Question

  • hi there,

    I am trying to compair a variable, but the code fails when I use a relational operator, but works fine if i use logical operator.


    code with logical operator, workin fine.
    var differences  = 60;
    if (differences == 60){
            crmForm.all.new_instalment.DataValue= difference;
    }




    code with relational operator not working.
    var differences  = 66;
    if (differences <= 60){
            crmForm.all.new_instalment.DataValue= difference;
    }


    any help with the problem, how do we use relational operators in crm, would be appriciated.
    Thursday, October 9, 2008 3:05 PM

Answers

  • Hi,

     

    What fails in your example? Do you get any error related to the code itself? Or, by failing, do you mean that the code in the block is not executed? If so, this is a perfeclty valid behavior, as 66 is not less than 60, so the code in if is not run at all...

     

    Operators: <= less or equal, >= greater or equal, < less, > greater, == equal

     

    Kuba

     

    Thursday, October 9, 2008 3:21 PM

All replies

  • Hi,

     

    What fails in your example? Do you get any error related to the code itself? Or, by failing, do you mean that the code in the block is not executed? If so, this is a perfeclty valid behavior, as 66 is not less than 60, so the code in if is not run at all...

     

    Operators: <= less or equal, >= greater or equal, < less, > greater, == equal

     

    Kuba

     

    Thursday, October 9, 2008 3:21 PM
  • well this was not the actual code i was working on it was a simplified dummy code, and thanks for pointing ma mistake out,

     

    But thanks alot for your help i saved the code and published it again and now it works.

    Thursday, October 9, 2008 3:41 PM