佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 928|回复: 2

Javascript 问题

[复制链接]
发表于 26-11-2007 09:51 PM | 显示全部楼层 |阅读模式
halo..i got some javascript problem..i need some help.
i have a hidden form value which contain of the TOTAL., let say the total is rm100.
then i have anohter two radio button and two text box, one radio button for one text box.
for the first radio button & textbox set, the user should insert the percentage; for the second radio button and terxt box set, the user should insert the ringgit malaysia.
then how can i get the value form the hidden and the text box and radio button, it will automatically calcualte the discount rate witout submit any button.
let say i have the hidden total is rm100, then i choose ringgit radio button and insert rm50 into the text box, then below there will display rm50(rm100-rm50)?..plz help..plz guide me some coding..thanx.
回复

使用道具 举报


ADVERTISEMENT

发表于 27-11-2007 11:51 AM | 显示全部楼层
可能说说你写了什么,这样我们比较容易帮到你。
回复

使用道具 举报

发表于 27-11-2007 11:58 AM | 显示全部楼层
这是简单类似的做法,希望可以帮到你。
  1. <script type="text/javascript" language="javascript">
  2. function sum(val)
  3. {
  4.   var returnValue = "";
  5.   returnValue = 100 - val;
  6.   document.getElementById("display").innerHTML=returnValue;
  7. }
  8. </script>
  9. <input type="text" onkeyup="total(this.value)">
  10. <br>
  11. <span id="display"></span>
复制代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 20-9-2025 07:00 PM , Processed in 0.154674 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表