Play Framework HTML5 input elements

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.

15,335 thoughts on “Play Framework HTML5 input elements

  1. 광명출장마사지는 경기도 광명 지역에서 고객이 있는 숙소나 자택으로 마사지사가 직접
    방문하여 서비스를 제공하는 형태를 의미합니다.
    주된 이용 목적은 피로 회복이나 휴식이며

  2. You’ve made some good points there. I looked on the
    net to find out more about the issue and found most people
    will go along with your views on this site.

  3. I do not even know how I ended up here, but
    I thought this post was great. I don’t know who you are but definitely you are going to a
    famous blogger if you aren’t already ;) Cheers!

  4. Howdy! This article could not be written any better!
    Looking at this article reminds me of my previous roommate!
    He continually kept talking about this. I am going to send this information to him.
    Pretty sure he’ll have a great read. Thanks for sharing!

  5. Thanks a lot for sharing this with all people you really realize what you’re speaking approximately!
    Bookmarked. Kindly additionally talk over with my site =).
    We will have a link alternate arrangement between us

  6. This is the perfect website for anyone who hopes to understand this
    topic. You know so much its almost tough to argue with you (not that I personally will
    need to…HaHa). You certainly put a brand new spin on a topic that has been discussed for
    many years. Great stuff, just excellent!

  7. Right here is the right website for anyone who wants to find out about this topic.

    You understand a whole lot its almost hard to argue with you (not that I actually will need to…HaHa).
    You certainly put a brand new spin on a subject which
    has been written about for years. Wonderful stuff, just excellent!

  8. Howdy! I’m at work surfing around your blog from my new
    iphone! Just wanted to say I love reading your blog and look
    forward to all your posts! Carry on the superb work!

  9. در یک نگاه کلی

    برای کسانی که

    بازی انفجار آنلاین

    مشغولن

    اینجا

    کاملاً می‌تونه

    جزو بهترین‌ها باشه

    از این جهت هم

    برندهایی مثل

    enfejar оnline

    و

    سرویس sibbet

    اثرگذار بودن

    در کل داستان

    برام جالب بود

    و

    باز هم حتما

    بازدیدش می‌کنم

    Also visit my website – سایت نرم افزار – Laura,

  10. Do you mind if I quote a couple of your posts as long as I provide
    credit and sources back to your weblog? My blog site is in the very same area of interest as yours and my users would certainly benefit from a lot of the
    information you present here. Please let me know if this ok with you.
    Many thanks!

  11. Hi there, I enjoy reading through your article post. I wanted to write a little comment to support you.

  12. Terrific work! This is the type of information that are supposed to be shared across the
    web. Shame on Google for no longer positioning this publish upper!
    Come on over and consult with my web site .
    Thank you =)

  13. Hello, i feel that i noticed you visited my site thus
    i got here to return the want?.I am trying to to find things to enhance my website!I guess
    its adequate to make use of some of your ideas!!

  14. It’s truly very complex in this active life to listen news on Television, thus I just use world wide web for
    that reason, and take the most up-to-date news.

  15. Great post. I was checking continuously this blog and I am inspired!
    Very useful info particularly the closing section :) I deal with such
    info a lot. I used to be looking for this particular info for a very
    lengthy time. Thanks and good luck.

  16. It is appropriate time to make some plans for the future and it’s time to be happy.
    I have read this put up and if I may I desire to suggest you few fascinating things or tips.

    Perhaps you can write subsequent articles regarding this article.

    I desire to learn even more issues about it!

  17. I recently came across an detailed article about Paybis and honestly it caught my attention.

    The post explained how people are using crypto in smarter ways, and it felt real.

    After checking it out, I recommended it to my
    family member, and he decided to explore it. Within the next month, he started managing his money differently.

    He didn’t just sit around — he actually applied what
    he learned. Eventually, he got close to 150k in results — not overnight, but through
    smart decisions.
    What surprised me most is how his lifestyle
    changed. He even finally bought something he always wanted, something like an Audi A5, and completely
    changed his mindset. He even built a new social circle around
    success.
    This isn’t magic or guaranteed, but the story is true from
    what I’ve seen, and that article definitely made a big
    impact.
    There’s actually a way to check it out here, and I’d seriously
    say it’s worth your time.
    Information really can make a difference.

  18. Hi! This post could not be written any better!

    Reading this post reminds me of my previous room mate!
    He always kept chatting about this. I will forward this page to him.
    Pretty sure he will have a good read. Thank you for sharing!

  19. I recently came across an eye-opening article about
    a crypto platform called Paybis and honestly it really made me think.

    The guide shared insights on how digital finance is evolving, and
    it wasn’t full of complicated jargon.
    After going through it, I told my uncle, and he got really interested.
    Within the next month, he looked at new income opportunities.

    He didn’t just sit around — he actually applied what he learned.
    Eventually, he even pushed towards 200k depending on timing — not overnight,
    but through consistency.
    What surprised me most is how his lifestyle changed. He even upgraded his lifestyle, something like
    a BMW 3 Series, and became more confident. He even built a new social
    circle around success.
    I’m not saying this will happen to everyone, but the story is real,
    and that article definitely changed the way we look at money.

    There’s actually a way to check it out here, and I’d seriously advise you to check it.

    Information really can make a difference.

  20. Hello There. I found your blog using msn. This is a very well
    written article. I will make sure to bookmark it and return to read more of your
    useful info. Thanks for the post. I will certainly return.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>