js 页面填写数字,自动计算
来源:互联网 发布:亚太会计师事务所 知乎 编辑:程序博客网 时间:2024/05/17 08:06
1. input 填写数值,并且自动计算。
页面
<table><tr><td>邮费<div>Postage(RBM)</div></td><td><input type="text" id="postage" name="postage" onkeyup="value=value.replace(/[^\d\.]/g,'');SumNum();" /></td></tr> <tr><td>其他费用<div>Package Fee</div></td><td><input type="text" id="otherFee" name="otherFee" onkeyup="value=value.replace(/[^\d\.]/g,'');SumNum();" /></td><td>合计费用<div>Total Fee</div></td><td><input type="text" id="totalFee" name="totalFee" /></td></tr></table>
js
// for the totalFee count autofunction SumNum(){ var sumValue; postage=eval(document.getElementById('postage').value); otherFee=eval(document.getElementById("otherFee").value);if(postage==null){postage=0;}if(otherFee==null){otherFee=0;}sumValue = postage+otherFee;$("#totalFee").attr("value",sumValue);}
js 关于是否number类型校验,本来是用 isNaN(), 但是一直抱错。
- js 页面填写数字,自动计算
- 输入框只能填写数字,其他值自动清空
- 使用WebClient自动填写并提交ASP.NET页面表单
- 使用WebClient自动填写并提交ASP.NET页面表单
- 使用WebClient自动填写并提交ASP.NET页面表单
- 使用WebClient自动填写并提交ASP.NET页面表单
- 使用WebClient自动填写并提交ASP.NET页面表单
- js数字计算
- js 页面数字倒计时
- js 在TEXTBOX填写数据后自动传TEXTBOX值
- js 创建书签小工具并实现自动表单填写
- js计算页面执行时间
- js自动计算值
- js 自动计算值
- 文本框只能填写数字
- js自动刷新页面
- js页面自动跳转
- js自动刷新页面
- javascript抖动元素的小例子
- ios内购(iap)关于问题“您已经购买了此程序内购买(In App Purchase)项目,但尚未下载"的解决方案
- java.lang.IllegalArgumentException: Too many bind arguments. 1 arguments were provided but the stat
- MFC下多线程实现socket通信
- hashCode和equals什么时候覆写以及怎样覆写
- js 页面填写数字,自动计算
- 13.Linux多命令协作:管道及重定向
- OCP-1Z0-052-V8.02-130题
- 学习日记之shell通配符
- EXTJS4 gridpanel中getColumnModel动态的显示/隐藏某个列
- MySQL C 语言应用程序接口开发教程
- 打算从今天开始写一写视频标准HEVC HM代码的学习的总结了
- 让程序在崩溃时体面的退出之SEH
- mysql存储过程示例(使用嵌套游标)