网页代码设计技巧系列之-根据人币面额输入张数算出总数.docVIP

  • 5
  • 0
  • 约2.8千字
  • 约 21页
  • 2018-07-05 发布于浙江
  • 举报

网页代码设计技巧系列之-根据人币面额输入张数算出总数.doc

网页代码设计技巧系列之-根据人币面额输入张数算出总数

要完成此效果需要两个步骤 第一步:把如下代码加入到head区域中 SCRIPT LANGUAGE=JavaScript !-- Begin function s(num, val) { amount = num * 1; // amount is the num or NaN sum = (!num ? 0 : num) * val; // the sum for that bill or coin if (isNaN(amount)) { // if the entire is not a number alert( + num + is not a valid entry and that field will + not be included in the total money calculation. ); return 0; } else return sum; // if it is OK, send sum back } function money(form) { hun = s(form.hun.value, 100); // Each amount is the returned value fif = s(form.fif.value, 50); // for the amount in the s() function twe =

文档评论(0)

1亿VIP精品文档

相关文档