playframework 2.3 - Play framework 2 Constraints client side validation -
i using play framework , wondering if there helper template out there (even 3rd party) add html5 attributes (e.g. required) based on model annotations.
for example on model
public class mymodel { constraints.required(message="required") public string name; } on view.scala.html
@helper.inputtext( field = mymodelform("name"), '_label -> "name", '_class -> "form-control", '_showconstraints -> false, '_showerrors -> true) is there existing set of helper templates or 3rd party plugin add required attribute on html element?
i thought creating own helper templates i'm not familiar scala , not know how use reflection check attributes. if familiar syntax, please help! give me flexibility use angular validation or jquery validation it's not requirement @ point.
thank in advance!
there module this: https://github.com/loicdescotte/play2-html5tags
i tested seems need (at least popular constraints required minlength etc. allows use input fields email or number type.
if won't satisfy i'm pretty sure can use reference , create custom solution.
Comments
Post a Comment