In Play 2.0 templates, there are some helpers to build form inputs: @inputText
, @inputPassword
, etc.
With existing helpers, I did not find a way to build HTML5 input like these:
<input type="email" ... />
<input type="url" ... />
Do I need to make my own helpers, or did I miss something?
Play 2.0 view helper are defined in package views.helper
. HTML 5 new types are currently missing from the list. But it should be really easy to extend it yourself. See for example the @inputPassword
source.
Seems some one already fixed this in 2.0.4. You can now do this:
@inputText(
myform("email"),
'_showConstraints -> false,
'_label -> Messages("label.email"),
'type -> "email"
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With