The built in Play input elements are fairly restrictive in that you can’t specify the input type. I wrote a helper template that you can use to generate input elements which have HTML5 type attributes such as url, email, number, search etc. etc.
All you have to do is call the template method, passing the HTML input type as a parameter. For example:
@helper.html5.input(form("website"), '_label -> "Website:", 'type -> "url")
If you have a form field mapped as a play.api.data.Forms.email then the template will automatically infer it’s type so you don’t have to pass the type attribute in with your html attributes:
@helper.html5.input(form("email"), '_label -> "Email:")
If your field has the required constraint, e.g. it is a “nonEmptyText” then the template will add the HTML5 “required” attribute to the field as well.
You can get the source code here.
It’s a shame you don’t have a donate button! I’d
without a doubt donate to this excellent blog! I guess for now i’ll settle
for bookmarking and adding your RSS feed to my Google account.
I look forward to new updates and will talk about this blog with my Facebook
group. Chat soon!
online sportweddenschappen eu
Here is my web-site … Top Wedden Sites Lijst; Https://Basketball-Wetten.Com/,
wedstrijd mobiel verleden tijd wedden – Karry,
golf weddenschap voor geld
Feel free to surf to my homepage … basketball-wetten.com
Very nice post. I just stumbled upon your weblog
and wanted to say that I have really enjoyed
surfing around your blog posts. After all I will be subscribing to your feed and
I hope you write again soon!