This question has been flagged
7935 Views

In Version 7... Lets Consider I have 3 fields called "basic", "tac_perc" and "tac_amt"..

And the calculation goes like this: Basic: 1000 TAC %: 20 TAC Amount: 200

(i.e) 20 % on basic will be my TAC amount which is 200..

(Or) if u had entered 200 in tac_amount then 20 will be calculated as TAC %...

Now I have written 2 onchange functions: [Which is working good]

  1. onchange_percent: which calculates n give me TAC amount
  2. onchange_amount: which calculates n give me TAC %..

    <field name="tac_perc" on_change="onchange_percent(basic, tac_perc)"/>

    <field name="tac_amt" on_change="onchange_amount(basic, tac_amt)"/>

So When I enter 10% in "tac_perc" field, It calls the onchange_percent, which will calculate and populates the value to "tac_amount", but then again since "tac_amount" field is also having onchange method [onchange_amount], it then executes n returns the value to "tac_perc".. and the process continues...

So my question is How to stop the dynamicall triggering the Onchange Event.. or is there anyway to know how through which the onchange event is called...

Avatar
Discard