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.
What’s Taking place i’m new to this, I stumbled upon this I
have found It positively helpful and it has aided me out
loads. I hope to give a contribution & assist other
users like its helped me. Good job.
Great article! We are linking to this great content on our website.
Keep up the great writing.
Also visit my site: idrtoto
I don’t know if it’s just me or if everyone else experiencing problems with your blog.
It looks like some of the written text on your posts are running off the screen. Can somebody else please comment and let me know if this is
happening to them too? This may be a problem with my internet browser
because I’ve had this happen before. Many thanks
Pretty nice post. I just stumbled upon your blog and
wished to say that I have really enjoyed surfing around
your blog posts. After all I will be subscribing to
your rss feed and I hope you write again very soon!
Here is my webpage – Hydraulic motor dealer
I blog often and I genuinely thank you for
your information. This great article has really peaked my
interest. I’m going to take a note of your website and keep checking for new details about once a
week. I opted in for your RSS feed as well.
Feel free to surf to my blog post: BOBATOTO
WOW just what I was searching for. Came here by searching for kra18 cc
I’m amazed, I have to admit. Seldom do I come across a blog
that’s both equally educative and engaging, and let
me tell you, you have hit the nail on the head.
The problem is something not enough folks are speaking intelligently about.
I am very happy I stumbled across this during my search for something relating to this.