Spring form: input for number
I am using the Spring form: input as shown below:
<form:input type="number" .....> in my jsp, but when I check the html that is displayed in the browser, it looks like this:
type="number" type="text" i., two type attributes are generated in html.
On the other hand, if I check with the option to check the item in the browser, it shows correctly - only type="number" , as expected.
Edit - My question is: Why do I get two type attributes in the generated html ( type="number" type="text" )? How to solve it?
HTML 5 with <!DOCTYPE html> has its own solution :
<input type="number">
Beware that does not work in the standard way in some browsers .
Try input type = "number" to see the HTML5 version in action.
See also https://github.com/jonstipe/number-polyfill for transparent support in older browsers.