I still struggle with the form validation and form helpers in Play 2.0. I have this login screen that I use together with the Twitter Bootstrap. So my login form looks like this
@elements.infos.mkString(", ")
. You are displaying the information about the field there. Remove it to don't display the information.Add this code:
@if(elements.hasErrors) {
@elements.infos.mkString(", ")
}
To set the classname: add this to your Twitter Bootstrap field: class="@elements.args.get('_class)
. And in your login form add the class parameter, like this: @inputText(loginForm("email"), '_label -> "Email", '_class -> "classname")
To understand the concept, take a look at the source code: https://github.com/playframework/Play20/blob/master/framework/src/play/src/main/scala/views/helper/defaultFieldConstructor.scala.html