Note that there are some explanatory texts on larger screens.

plurals
  1. POForm validation - Minimum number value
    text
    copied!<p>Could someone offer me some advice as to form validation that restricts entry of a number below 5. I have got a donation form, simply an amount input field and a submit button to paypal.</p> <p>What form validation shall I use to restrict submission of the form if the amount value is below 5 (for £5.00).</p> <p>The form is below:</p> <pre><code>&lt;form target="paypal" id="donate" action="https://www.paypal.com/cgi-bin/webscr" method="post" &gt; &lt;div class="span6 text-center"&gt; &lt;input type="hidden" name="cmd" value="_cart"&gt; &lt;input type="hidden" name="business" value="SECRET-ID"&gt; &lt;input type="hidden" name="lc" value="GB"&gt; &lt;input type="hidden" name="item_name" value="General"&gt; &lt;input type="hidden" name="item_number" value="GEN"&gt; &lt;div class="input-prepend input-append"&gt; &lt;span class="add-on"&gt;£&lt;/span&gt; &lt;input class="span12" name="amount" value="5" placeholder="Enter Donation Amount" id="appendedPrependedInput" size="20" type="text"&gt; &lt;input type="hidden" name="currency_code" value="GBP"&gt; &lt;input type="hidden" name="button_subtype" value="products"&gt; &lt;input type="hidden" name="no_note" value="0"&gt; &lt;input type="hidden" name="cn" value="Add special instructions to the seller:"&gt; &lt;input type="hidden" name="no_shipping" value="2"&gt; &lt;input type="hidden" name="add" value="1"&gt; &lt;input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHostedGuest"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="span6 text-center"&gt; &lt;div class="controls"&gt; &lt;a id="buynow" class="btn btn-danger" href="#" rel="nofollow" onclick="document.getElementById('donate').submit(); return false;"&gt; &lt;span style=""&gt;Donate via PayPal!&lt;/span&gt;&lt;/a&gt; &lt;noscript&gt; &lt;style&gt;#buynow { display: none; } #page_theme #donate input { display: inline; }&lt;/style&gt; &lt;input type="submit" class="btn btn-danger" value="Donate via PayPal!"&gt; &lt;/noscript&gt; &lt;/div&gt; &lt;/div&gt; &lt;img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1"&gt; &lt;/form&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload