Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring form:input for number

I am using Spring's form:input as below :

<form:input type="number" .....>

in my jsp but when I check the html that is rendered on the browser it shows like :

type="number" type="text"

i.e., two type attributes are generated in the html.

On the other hand, if I check using inspect element option in the browser, it shows correct - only type="number" as expected.
Edit- My Question: Why am I getting two type attributes in generated html (type="number" type="text") ? How to get it resolved?

like image 446
iAmLearning Avatar asked Nov 26 '14 04:11

iAmLearning


1 Answers

Spring form:input tag doesnt have any attribute named type and the type=number used in your code belongs to html5 input tag

Also have a look at HTML Text Input allow only Numeric input

Spring form tld lists the valid attributes of form:input element here

like image 162
Santhosh Avatar answered Oct 15 '22 02:10

Santhosh