Reputation: 1327
I am using Spring forms and would like to use the HTML5 'required' attribute which Spring forms does not seem to support.
<form:input path="someinput" cssClass="required"/>
I cannot seem to do
<form:input path="someinput" cssClass="required" required="required"/>
as this is currently not supported by the Spring TLD.
It seems like I NEED to ditch spring forms if I want to use the full HTML5 spec
<input name="someinput" id="someinput" class="required" required="required"></input>
Does anyone know how I can implement the required field with spring forms 3.1.3.RELEASE? Thanks!
Upvotes: 1
Views: 5735
Reputation: 763
just add some jquery at the end of the page
<html>
<body>
<form:input path="someinput" id="someinput"/>
</body>
<script>
$("#someinput").attr('required', '');
</script>
</html>
Upvotes: 3
Reputation: 84
commandName
, your approach is ok.Upvotes: 0