title: Only numbers in textbox not greater than account balance
body: <p>I am working on a bitcoin website, and every user has an account balance that looks like this: 1.26584000 or 0.00032568. Note that there are always 8 digits after the decimal.</p>
  
  <p>Now I want users to fill in a textbox with an amount of bitcoins, but this textbox may only contain numbers, and if the number is greater then the account balance it should automatically replace with their maximum available balance.</p>
  
  <p>The account balance is stored in a php variable ($balance) as a string like this:</p>
  
  <pre><code>$balance = number_format((float)$activeUser['balance'], 8, '.', '');
  </code></pre>
  
  <p>The current textbox I have looks like this:</p>
  
  <pre><code>&lt;input class="form-control col-md-10 input-lg" type="text" value="0.00000000" /&gt; 
  </code></pre>
  
  <p>I already found some solutions with Javascript but I couldn't get the result how I wanted it to be.</p>