0

I'm developing web application using Grails and I encountered very strange obstacle. I've created simple form in gsp, one of the parameters to fill up is a number field. I've used grails built-in tag <g:field type="number" name="orderOfSubpage"> and generated HTML is <input type="number" name="orderOfSubpage" value="" id="orderOfSubpage">. Everything seemed to be fine, but when I was testing the form and I put a letter into number field, I got dialog box with a warning saying that I have to put a number in the field.

I've removed all javascript files included into app OOTB and I didn't add any client-side validation on my own.

Finally, the question. How to disable this strange dialog saying: "Please enter a number"? I don't want it to appear in my app.

I'm attaching a screenshot to clarify it better. enter image description here

kmb
  • 871
  • 5
  • 17
  • 34
  • 1
    That's an [HTML5 validation message](http://diveintohtml5.info/forms.html#validation) generated by your browser as you said to expect a number – tim_yates Jan 15 '14 at 16:50
  • http://stackoverflow.com/questions/3090369/disable-validation-of-html5-form-elements – tim_yates Jan 15 '14 at 16:52

1 Answers1

0

This is caused by HTML5 form validation and not Javascript. Add "novalidate" attribute to your g:form tag to disable the validation.

<g:form novalidate="novalidate" ...
Rami Enbashi
  • 3,526
  • 1
  • 19
  • 21