我有一個簡單的表單。我想用我簡單的公式計算隱藏字段的值(分割率從下拉開始減少100,然後將它與文本字段的估計工資相乘)。onSubmit無法在任何瀏覽器中工作
但是,對於某些奇怪的原因,onSubmit不起作用。形式我想在表單提交,但它沒有被稱爲在任何瀏覽器來計算上述值這是非常奇怪的問題
這裏是代碼:。
<script type="text/javascript">
function calc1()
{
var a= document.getElementById('inf_custom_FLRaterClassCode0').value;
var b = document.getElementById('inf_custom_FLRaterEstimatedPayroll').value;
document.getElementById('inf_custom_EstimatedQuote').value=parseFloat(a)/100 * parseFloat(b) ;
}
</script>
<form accept-charset="UTF-8" action="https://kg933.infusionsoft.com/app/form/process/968a6b704587136af8684f30cc8c5cf4" class="infusion-form" method="GET" onSubmit="calc1();">
<input name="inf_form_xid" type="hidden" value="968a6b704587136af8684f30cc8c5cf4" />
<input name="inf_form_name" type="hidden" value="Full Quote - Florida Rate" />
<input name="infusionsoft_version" type="hidden" value="1.28.7.21" />
<div class="infusion-field">
<label for="inf_field_FirstName">First Name *</label>
<input class="infusion-field-input-container" id="inf_field_FirstName" name="inf_field_FirstName" type="text" />
</div>
<div class="infusion-field">
<label for="inf_field_LastName">Last Name *</label>
<input class="infusion-field-input-container" id="inf_field_LastName" name="inf_field_LastName" type="text" />
</div>
<div class="infusion-field">
<label for="inf_field_Company">Company *</label>
<input class="infusion-field-input-container" id="inf_field_Company" name="inf_field_Company" type="text" />
</div>
<div class="infusion-field">
<label for="inf_field_Email">Email *</label>
<input class="infusion-field-input-container" id="inf_field_Email" name="inf_field_Email" type="text" />
</div>
<div class="infusion-field">
<label for="inf_field_Phone1">Phone 1 *</label>
<input class="infusion-field-input-container" id="inf_field_Phone1" name="inf_field_Phone1" type="text" />
</div>
<div class="infusion-field">
<label for="inf_custom_FLRaterClassCode0">FL Rater - Class Code #2 *</label>
<select id="inf_custom_FLRaterClassCode0" name="inf_custom_FLRaterClassCode0"><option value="">Please select one</option><option value="9519">9519</option><option value="5473">5473</option><option value="5472">5472</option><option value="9516">9516</option><option value="8393">8393</option><option value="8380">8380</option><option value="5188">5188</option></select>
</div>
<div class="infusion-field">
<label for="inf_custom_FLRaterEstimatedPayroll">FL Rater - Estimated Payroll *</label>
<input class="infusion-field-input-container" id="inf_custom_FLRaterEstimatedPayroll" name="inf_custom_FLRaterEstimatedPayroll" type="text" />
</div>
<input name="inf_custom_EstimatedQuote" type="hidden" value="" />
<div class="infusion-submit">
<input type="submit" value="Submit" />
</div>
</form>
完美的作品。不知道我是如何錯過這樣一個愚蠢的錯誤。 – 2013-04-09 18:11:12