有人可以给我一些建议,以限制输入低于 5 的数字的表单验证。我有一个捐赠表格,只是一个金额输入字段和一个到 paypal 的提交按钮。
如果金额值低于 5(5.00 英镑),我应该使用什么表单验证来限制提交表单。
表格如下:
<form target="paypal" id="donate" action="https://www.paypal.com/cgi-bin/webscr" method="post" >
<div class="span6 text-center">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="SECRET-ID">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="item_name" value="General">
<input type="hidden" name="item_number" value="GEN">
<div class="input-prepend input-append">
<span class="add-on">£</span>
<input class="span12" name="amount" value="5" placeholder="Enter Donation Amount" id="appendedPrependedInput" size="20" type="text">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="button_subtype" value="products">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="cn" value="Add special instructions to the seller:">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="add" value="1">
<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHostedGuest">
</div>
</div>
<div class="span6 text-center">
<div class="controls">
<a id="buynow" class="btn btn-danger" href="#" rel="nofollow" onclick="document.getElementById('donate').submit(); return false;">
<span style="">Donate via PayPal!</span></a>
<noscript>
<style>#buynow { display: none; } #page_theme #donate input { display: inline; }</style>
<input type="submit" class="btn btn-danger" value="Donate via PayPal!">
</noscript>
</div>
</div>
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>