http://www.aquaticsystems.com/chemapp2.html
CSS和JS在页面中,没有链接,因为我不想要网站的背景。在任何情况下,它是并且正在为前两种形式工作但是当我添加第三种形式时,它只是复制/粘贴并更改名称和1号,第三种不计算并且似乎在寻找某些东西来自网站。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Herbicide Calculators</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<style type="text/css">
.title {font-family: Arial, Helvetica, sans-serif;font-size: 16px;color: #15649D;font-weight: bold;text-align: center;}
.txt {font-family: Arial, Helvetica, sans-serif;font-size: 12px;color: #333;}
.txt2 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;font-weight: bold;color: #15649D;}
.table {font-family: Arial, Helvetica, sans-serif;font-size: 12px;color: #333;font-family: Arial, Helvetica, sans-serif;
border-top-style: none;border-right-style: none;border-bottom-style: none;border-left-style: none;}
.calculator {float: left;width: 280px;padding: 3px;border-radius: 5px;-moz-border-radius: 5px;color: #000;margin-top: 0;margin-right: 3px;margin-bottom: 3px;margin-left: 3px;border: thin solid #333;}
.calculator .form-row {overflow: auto;padding: 2px 2px;border: thin solid #333;font-family: Arial, Helvetica, sans-serif;font-size: 12px;}
.calculator .form-row LABEL {float: left;width: 130px;line-height: 2em;vertical-align: text-bottom;}
.calculator .form-row INPUT {float: right;width: 130px;}
.calculator .form-row.last-row {background-color: #9FECF2;}
.calculator .form-row.last-rowb {background-color: #A7D2F3;color: #333;}
.calculator .form-row-buttons {text-align: center;margin-top: 5px;}
.calculator SMALL {line-height: 0.7em;font-size: 10px;}
.calculator DD {font-size: 11px;font-style: italic;margin-bottom: 0;}
.calculator DT {font-size: 11px;font-weight: bold;}
</style>
<script language="JavaScript" type="text/javascript">
$(document).ready(function() {
$('#a_qty_calculator').submit(function() {a_qty_calc(); return false;});
$('#b_qty_calculator').submit(function() {b_qty_calc(); return false;});
$('#c_qty_calculator').submit(function() {c_qty_calc(); return false;});
});
function a_qty_calc() {
var pr = parseFloat($('#pr').val());
var sw = parseFloat($('#sw').val());
var ad = parseFloat($('#ad').val());
var dc = parseFloat($('#dc').val());
var pg = parseFloat($('#pg').val());
var ta = Math.round((pr * sw) / 43560 * 10) / 10;
var taf = Math.round(ad * ta * 10) / 10;
var ga = Math.round((taf * dc * 2.72) / pg * 10) / 10;
var oa = Math.round(ga * 128 * 10) / 10;
var gab = Math.round(ga / 1000 * 100) / 100;
var oab = Math.round(gab * 128 * 100) / 100;
$('#ta').val(ta);
$('#taf').val(taf);
$('#ga').val(ga);
$('#oa').val(oa);
$('#gab').val(gab);
$('#oab').val(oab);
}
function b_qty_calc() {
var wad = parseFloat($('#wad').val());
var wdc = parseFloat($('#wdc').val());
var wpg = parseFloat($('#wpg').val());
var wta = parseFloat($('#wta').val());
var wtaf = Math.round(wad * wta * 10) / 10;
var wga = Math.round((wtaf * wdc * 2.72) / wpg * 10) / 10;
var woa = Math.round(wga * 128 * 10) / 10;
var wgab = Math.round(wga / 1000 * 100) / 100;
var woab = Math.round(wgab * 128 * 100) / 100;
$('#wtaf').val(wtaf);
$('#wga').val(wga);
$('#woa').val(woa);
$('#wgab').val(wgab);
$('#woab').val(woab);
}
function c_qty_calc() {
var ppr = parseFloat($('#ppr').val());
var psw = parseFloat($('#psw').val());
var pad = parseFloat($('#pad').val());
var pdc = parseFloat($('#pdc').val());
var ppg = parseFloat($('#ppg').val());
var pta = Math.round((ppr * psw) / 43560 * 10) / 10;
var ptaf = Math.round(pad * pta * 10) / 10;
var pga = Math.round((ptaf * pdc * 2.72) / pg * 10) / 10;
var poa = Math.round(pga * 16 * 10) / 10;
var pgab = Math.round(pga / 1000 * 100) / 100;
var poab = Math.round(pgab * 16 * 100) / 100;
$('#pta').val(pta);
$('#ptaf').val(ptaf);
$('#pga').val(pga);
$('#poa').val(poa);
$('#pgab').val(pgab);
$('#poab').val(poab);
}
</script>
</head>
<body>
<table width="508" border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
<td width="60%">
<form action="" class="calculator" id="a_qty_calculator" method="post">
<span class="title">ASI Perimeter Treatment: Liquid</span>
<div class="form-row optional">
<label for="pr">Perimeter</label>
<input id="pr" name="pr" type="text"/>
</div>
<div class="form-row optional">
<label for="sw">Swath Width</label>
<input id="sw" name="sw" type="text"/>
</div>
<div class="form-row optional">
<label for="ad">Average Depth</label>
<input id="ad" name="ad" type="text"/>
</div>
<div class="form-row optional">
<label for="dc">Desired Concentration</label>
<input id="dc" name="dc" type="text"/>
</div>
<div class="form-row optional">
<label for="pg">Lbs of AI/Gallon</label>
<input id="pg" name="pg" type="text"/>
</div>
<div class="form-row optional last-row">
<label for="ta">Treatment Acres</label>
<input id="ta" name="ta" type="text"/>
</div>
<div class="form-row optional last-row">
<label for="taf">Treatment Area Acre Ft</label>
<input id="taf" name="taf" type="text"/>
</div>
<div class="form-row optional last-row">
<label for="ga">Gallons to Apply PPM</label>
<input id="ga" name="ga" type="text"/>
</div>
<div class="form-row optional last-row">
<label for="oa">Ounces to Apply PPM</label>
<input id="oa" name="oa" type="text"/>
</div>
<div class="form-row optional last-rowb">
<label for="gab">Gallons to Apply PPB</label>
<input id="gab" name="gab" type="text"/>
</div>
<div class="form-row optional last-rowb">
<label for="oab">Ounces to Apply PPB</label>
<input id="oab" name="oab" type="text"/>
</div>
<div class="form-row-buttons">
<input type='submit' id='submit' value="Calculate" />
<input name="reset" type="reset" value="Reset" />
</div>
</form></td>
<td width="40%" rowspan="3"><table width="200" border="1" cellspacing="0" cellpadding="5" class="table">
<tr valign="top">
<td colspan="2" class="txt2">Pounds of Active Ingredient per <br />
Gallon or Pounds of Product</td>
</tr>
<tr>
<td width="98">2, 4-D Amine </td>
<td width="55"> 3.8</td>
</tr>
<tr>
<td>Aquathol K</td>
<td>3.0 </td>
</tr>
<tr>
<td>Captain</td>
<td>0.91 </td>
</tr>
<tr>
<td>Clipper</td>
<td>0.51</td>
</tr>
<tr>
<td>CuSO4</td>
<td>1.0</td>
</tr>
<tr>
<td>Cutrine Plus</td>
<td>0.91</td>
</tr>
<tr>
<td>Diquat</td>
<td>2.0</td>
</tr>
<tr>
<td>Fluridone AS</td>
<td> 4.0</td>
</tr>
<tr>
<td>Habitat </td>
<td>2.0 </td>
</tr>
<tr>
<td>Hydrothol 191</td>
<td>2.0</td>
</tr>
<tr>
<td>Komeen</td>
<td>0.8</td>
</tr>
<tr>
<td>Navigate</td>
<td>0.2</td>
</tr>
<tr>
<td>Solar Genesis</td>
<td>0.5</td>
</tr>
</table></td>
</tr>
<tr>
<td><form action="" class="calculator" id="b_qty_calculator" method="post">
<span class="title">ASI Whole Lake Treatment: Liquid</span>
<div class="form-row optional">
<label for="wta">Treatment Acres</label>
<input id="wta" name="wta" type="text"/>
</div>
<div class="form-row optional">
<label for="wad">Average Depth</label>
<input id="wad" name="wad" type="text"/>
</div>
<div class="form-row optional">
<label for="wdc">Desired Concentration</label>
<input id="wdc" name="wdc" type="text"/>
</div>
<div class="form-row optional">
<label for="wpg">Lbs of AI/Gallon</label>
<input id="wpg" name="wpg" type="text"/>
</div>
<div class="form-row optional last-row">
<label for="wtaf">Treatment Area Acre Ft</label>
<input id="wtaf" name="wtaf" type="text"/>
</div>
<div class="form-row optional last-row">
<label for="wga">Gallons to Apply PPM</label>
<input id="wga" name="wga" type="text"/>
</div>
<div class="form-row optional last-row">
<label for="woa">Ounces to Apply PPM</label>
<input id="woa" name="woa" type="text"/>
</div>
<div class="form-row optional last-rowb">
<label for="wgab">Gallons to Apply PPB</label>
<input id="wgab" name="wgab" type="text"/>
</div>
<div class="form-row optional last-rowb">
<label for="woab">Ounces to Apply PPB</label>
<input id="woab" name="woab" type="text"/>
</div>
<div class="form-row-buttons">
<input name="submit" type="submit" value="Calculate"/>
<input name="reset" type="reset" value="Reset" />
</div>
</form></td>
</tr>
<tr>
<td><form action="" class="calculator" id="c_qty_calculator" method="post">
<span class="title">ASI Perimeter Treatment: Liquid</span>
<div class="form-row optional">
<label for="ppr">Perimeter</label>
<input id="ppr" name="ppr" type="text"/>
</div>
<div class="form-row optional">
<label for="psw">Swath Width</label>
<input id="psw" name="psw" type="text"/>
</div>
<div class="form-row optional">
<label for="pad">Average Depth</label>
<input id="pad" name="pad" type="text"/>
</div>
<div class="form-row optional">
<label for="pdc">Desired Concentration</label>
<input id="pdc" name="pdc" type="text"/>
</div>
<div class="form-row optional">
<label for="ppg">Lbs of AI/Gallon</label>
<input id="ppg" name="ppg" type="text"/>
</div>
<div class="form-row optional last-row">
<label for="pta">Treatment Acres</label>
<input id="pta" name="pta" type="text"/>
</div>
<div class="form-row optional last-row">
<label for="ptaf">Treatment Area Acre Ft</label>
<input id="ptaf" name="ptaf" type="text"/>
</div>
<div class="form-row optional last-row">
<label for="pga">Gallons to Apply PPM</label>
<input id="pga" name="pga" type="text"/>
</div>
<div class="form-row optional last-row">
<label for="poa">Ounces to Apply PPM</label>
<input id="poa" name="poa" type="text"/>
</div>
<div class="form-row optional last-rowb">
<label for="pgab">Gallons to Apply PPB</label>
<input id="pgab" name="pgab" type="text"/>
</div>
<div class="form-row optional last-rowb">
<label for="poab">Ounces to Apply PPB</label>
<input id="poab" name="poab" type="text"/>
</div>
<div class="form-row-buttons">
<input type='submit' id='submit' value="Calculate" />
<input name="reset" type="reset" value="Reset" />
</div>
</form></td></tr>
</table>
<p class="txt">©2012 Aquatic Systems, Inc. All rights reserved</p>
</body>
</html>
答案 0 :(得分:1)
在此
var pga = Math.round((ptaf * pdc * 2.72) / pg * 10) / 10;
行pg
必须为ppg
。
答案 1 :(得分:1)
由于我不知道如何使用除草剂计算器,而且我没有数据来测试它,很难弄清楚你的代码有什么问题,但我确实看到的一件事是你已经复制粘贴第三张表格了。提交按钮与之前的表单具有相同的id ='submit'。
在第78行,您使用了一个名为'pg'的变量,该变量尚未初始化 - 我认为您打算使用'ppg'变量。
从中学到的一课是正确命名变量,这样可以在调试代码时节省大量时间。
答案 2 :(得分:0)
var pga = Math.round((ptaf * pdc * 2.72) / ppg * 10) / 10;