Price input pattern html5

grails, html, regex

Solution

try this

[0-9]+(\\.[0-9][0-9]?)?
<form>
  <input type='number' pattern='[0-9]+(\\.[0-9][0-9]?)?' />
  <button type='submit'>Check</button>
</form>

Problem

I've got input field and I want to check dot existence for value of price input field. The value will be look like this `12.00`. Here is my code ``` <g:textField class="span3" id="price" name="price" required="" pattern="\d+(\.\d{2})?"/> ``` I write something like this `\d+(\.\d{2})?`, but received error. Any suggestions ?

Original source