I am currently using the Play Framework and wondering if there is an auxiliary template (even a third-party one) that will add HTML5 attributes (for example, the necessary ones) based on the model annotations.
For example, on my model
public class MyModel { Constraints.Required(message="Required") public String name; }
on my View.Scala.html
@helper.inputText( field = myModelForm("name"), '_label -> "Name", '_class -> "form-control", '_showConstraints -> false, '_showErrors -> true)
Is there an existing set of helper templates or a third-party plugin that will add the required attribute to the HTML element?
I was thinking of creating my own helper templates, but I am not very familiar with Scala and do not know how to use reflection to check attributes. If you are familiar with this syntax, please help! This would give me the flexibility to use Angular validation or jQuery validation, but this is not a requirement at the moment.
Thank you in advance!
source share