Answers.Body: <p>Ideally you would develop a little extension that uses the validateForm hook (check <a href="https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_validateForm/" rel="nofollow noreferrer">https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_validateForm/</a>). This will allow you to refuse input that does not meet your criteria.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-09T07:17:07.473Z
Answers.LastActivityDate: 2020-04-09T07:17:07.473Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>Is it possible to enforce a numbers only input with a numerical minimum on a <code>Text/Numeric</code> price field? I'm guessing it could be done with jQuery, but I would rather have this set up in the Civi Admin UI, since it would be much cleaner.</p>
  <p><strong>More details:</strong></p>
  <p>I have a price field set up like this:</p>
  <p><a href="https://i.sstatic.net/aa1o9.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/aa1o9.jpg" alt="enter image description here" /></a></p>
  <p><em>On the front end, it looks like this:</em> <em>(but I want 4 to be the lowest allowed number, with no letters input)</em></p>
  <p><a href="https://i.sstatic.net/Y5yIx.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Y5yIx.jpg" alt="enter image description here" /></a></p>
  <p>Basically, I want the HTML equal of <code>&lt;input type=&quot;number&quot; min=&quot;4&quot;/&gt;</code> in the cleanest and safest way possible. <em>(safe as in not hacking up some jQuery and then moving an element 3 months later and breaking it)</em></p>
  
Tags: <civimember><price-sets>
Title: Limit price field of type Text/Numeric to only numbers and with a minimum of 4
ThreadText: # Limit price field of type Text/Numeric to only numbers and with a minimum of 4
  
  (Asked by: username_0 on 2020-04-09)
  
  Is it possible to enforce a numbers only input with a numerical minimum on a `Text/Numeric` price field? I'm guessing it could be done with jQuery, but I would rather have this set up in the Civi Admin UI, since it would be much cleaner.
  
  **More details:**
  
  I have a price field set up like this:
  
  [![enter image description here](https://i.sstatic.net/aa1o9.jpg)](https://i.sstatic.net/aa1o9.jpg)
  
  *On the front end, it looks like this:* *(but I want 4 to be the lowest allowed number, with no letters input)*
  
  [![enter image description here](https://i.sstatic.net/Y5yIx.jpg)](https://i.sstatic.net/Y5yIx.jpg)
  
  Basically, I want the HTML equal of `<input type="number" min="4"/>` in the cleanest and safest way possible. *(safe as in not hacking up some jQuery and then moving an element 3 months later and breaking it)*
  
  **Tags:** civimember, price-sets
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-04-09. Score: 2
  
  Ideally you would develop a little extension that uses the validateForm hook (check <https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_validateForm/>). This will allow you to refuse input that does not meet your criteria.
  
  
  ---
  
  