javascript onpropertychange

javascript onpropertychangeNewDocument functioninit() { all_real(); } functionall_real() { varbasePay=document.all("hrSalary.basePay").value; vartextf…

大家好,又见面了,我是你们的朋友全栈君。<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN”>

<HTML>

<HEAD>

<TITLE> New Document </TITLE>

<META NAME=”Generator” CONTENT=”EditPlus”>

<META NAME=”Author” CONTENT=””>

<META NAME=”Keywords” CONTENT=””>

<META NAME=”Description” CONTENT=””>

</HEAD>

<script>

function init()

{

all_real();

}

function all_real()

{

var basePay = document.all(“hrSalary.basePay”).value;

var textfield2 = document.all(“textfield2”).value;

var textfield3 = document.all(“textfield3”).value;

var textfield100 = document.all(“textfield100”).value;

var textfield4 = document.all(“textfield4”).value;

var textfield5 = document.all(“textfield5”).value;

document.all(“textfield9”).value = all_earning(basePay,textfield2,textfield3,textfield100);

document.all(“textfield10”).value = all_pay(textfield4,textfield5);

document.all(“textfield11”).value = all_sub(document.all(“textfield9”).value,document.all(“textfield10”).value)

}

function all_earning(arg1,arg2,arg3,arg4)

{

var r1,r2,r3,r4,m;

try{r1=arg1.toString().split(“.”)[1].length}catch(e){r1=0}

try{r2=arg2.toString().split(“.”)[1].length}catch(e){r2=0}

try{r3=arg3.toString().split(“.”)[1].length}catch(e){r3=0}

try{r4=arg4.toString().split(“.”)[1].length}catch(e){r4=0}

m=Math.pow(10,Math.max(r1,r2,r3,r4))

return (arg1*m+arg2*m+arg3*m+arg4*m)/m

}

function all_pay(arg1,arg2)

{

var r1,r2,m;

try{r1=arg1.toString().split(“.”)[1].length}catch(e){r1=0}

try{r2=arg2.toString().split(“.”)[1].length}catch(e){r2=0}

m=Math.pow(10,Math.max(r1,r2))

return (arg1*m+arg2*m)/m

}

function all_sub(arg1,arg2)

{

var r1,r2,m;

try{r1=arg1.toString().split(“.”)[1].length}catch(e){r1=0}

try{r2=arg2.toString().split(“.”)[1].length}catch(e){r2=0}

m=Math.pow(10,Math.max(r1,r2))

return (arg1*m-arg2*m)/m

}

</script>

<BODY οnlοad=”init()”>

<table width=”98%” border=”0″ align=”center” cellpadding=”0″ cellspacing=”0″ class=”transparence”>

<td class=”GridShowList”>

基本工资

</td>

<td class=”GridWriterList”>

<input name=”hrSalary.basePay” value=”1000″ type=”text” size=”20″ onpropertychange=”all_real()”>

</td>

<td class=”GridShowList”>

岗位工资

</td>

<td class=”GridWriterList”>

<input name=”textfield2″ value=”1100″ type=”text” size=”20″ onpropertychange=”all_real()”>

</td>

</tr>

<tr>

<td class=”GridShowList”>

绩效工资

</td>

<td class=”GridWriterList”>

<input name=”textfield3″ value=”1200″ type=”text” size=”20″ onpropertychange=”all_real()”>

</td>

<td class=”GridShowList”>

加班

</td>

<td class=”GridWriterList”>

<input name=”textfield100″ value=”1300″ type=”text” size=”20″ onpropertychange=”all_real()”>

</td>

</tr>

</table>

———————————————————————————————————————————-

<table width=”98%” border=”0″ align=”center” cellpadding=”0″ cellspacing=”0″ class=”transparence”>

<tr>

<td class=”GridShowList”>

税金

</td>

<td class=”GridWriterList”>

<input name=”textfield4″ value=”100″ type=”text” size=”20″ onpropertychange=”all_real()”>

</td>

<td class=”GridShowList”>

养老保险

</td>

<td class=”GridWriterList”>

<input name=”textfield5″ value=”200″ type=”text” size=”20″ onpropertychange=”all_real()”>

</td>

</tr>

</table>

——————————————————————————————————————————————-

<table width=”98%” border=”0″ align=”center” cellpadding=”0″ cellspacing=”0″ class=”transparence”>

<tr>

<td class=”GridShowList”>

应发工资合计

</td>

<td class=”GridWriterList” colspan=”3″>

<input id=”sumPay” name=”textfield9″ value=”” type=”text” readonly=”true”>

</td>

<td class=”GridShowList”>

扣款合计

</td>

<td class=”GridWriterList” colspan=”3″>

<input id=”subPay” name=”textfield10″ type=”text” readonly=”true” >

</td>

<td class=”GridShowList”>

实发工资合计

</td>

<td class=”GridWriterList” colspan=”3″>

<input id=”real” name=”textfield11″ type=”text” readonly=”true”>

</td>

</tr>

</table>

</BODY>

</HTML>

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/158419.html原文链接:https://javaforall.cn

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)


相关推荐

发表回复

您的电子邮箱地址不会被公开。

关注全栈程序员社区公众号