跳至內容
選單
此問題已被標幟
9209 瀏覽次數

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...

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
10月 23
2088
2
10月 23
2323
2
8月 23
4343
4
8月 23
20678
3
10月 22
11131