Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Play! module for HTML5 validation of input tags

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 app
Octocat-spinner-32 conf
Octocat-spinner-32 documentation
Octocat-spinner-32 .checkstyle
Octocat-spinner-32 .classpath
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .project
Octocat-spinner-32 README.textile

HTML5 Validation

The HTML5 validation module provides a drop-in replacement for HTML <input> elements called #{input /} which automatically adds HTML5 validation attributes to the final output based on your Play! model validation annotations.


Suppose you have a Model class called User which has a field called name declared as

public String name;

you can replace your existing <input> element with the following:

#{input for:'', id:'YourID', class:'class1 class2' /}

The tag will then output the following HTML code:

<input name="" value="${user?.name}" id="YourID" class="class1 class2" required maxlength="8" pattern="[a-z]*">
Something went wrong with that request. Please try again.