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.

16,729 thoughts on “Play Framework HTML5 input elements

  1. 대밤은 대구·경북 수성구·달서구·동성로·구미·안동 지역별 업소 정보를 실방문 후기 기반으로 직접 비교 제공하는 플랫폼입니다.
    지역별 매니저 랭킹과 평점을 지금

  2. I’ve been surfing online greater than 3 hours today, yet I by no means found any fascinating article like yours.
    It’s beautiful price enough for me. In my view, if all website owners and bloggers made excellent
    content as you did, the internet will likely be a lot more helpful than ever before.

  3. For most recent information you have to pay a quick visit web
    and on world-wide-web I found this web site as a best web page for hottest
    updates.

  4. You really make it seem so easy with your presentation but I find this matter to be really something that I think
    I would never understand. It seems too complicated
    and extremely broad for me. I am looking forward for your next post, I will try to get the hang of it!

    Here is my webpage … realtor in Crown Point IN

  5. I used to be recommended this blog by way of my cousin. I’m no longer sure whether this post is written by way of him as no one else realize such unique
    approximately my trouble. You’re wonderful!

    Thanks!

  6. My spouse and I absolutely love your blog and find nearly all of your post’s to be just what I’m looking for.
    Would you offer guest writers to write content for you personally?
    I wouldn’t mind producing a post or elaborating on many of the subjects you write in relation to here.
    Again, awesome blog!

  7. Hmm it seems like your website ate my first comment
    (it was super long) so I guess I’ll just sum it up what I wrote and
    say, I’m thoroughly enjoying your blog. I as well
    am an aspiring blog blogger but I’m still new to everything.
    Do you have any helpful hints for beginner blog writers?
    I’d genuinely appreciate it.

  8. This is really interesting, You’re a very professional blogger.
    I’ve joined your rss feed and look ahead to looking for extra of your great post.
    Also, I have shared your site in my social networks

  9. Hi it’s me, I am also visiting this web site daily, this website is in fact fastidious and the people
    are truly sharing good thoughts.

  10. I was wondering if you ever thought of changing the layout of your blog?

    Its very well written; I love what youve got to say.
    But maybe you could a little more in the way
    of content so people could connect with it better. Youve got an awful lot of
    text for only having one or 2 images. Maybe you could space it out better?

    Also visit my web site real estate agent Chicago IL

  11. Just wish to say your article is as astonishing.
    The clarity for your submit is just great and that i can suppose you’re a
    professional on this subject. Fine together with your permission let me to take hold of
    your RSS feed to keep up to date with coming near near
    post. Thanks a million and please carry on the rewarding work.

  12. Wow! Finally I got a weblog from where I can in fact get valuable information regarding my study
    and knowledge.

  13. My whole view of betting changed the day I discovered how sure bets
    work. It felt too good to be true that you could bet without worrying about losing.

    The moment I ran the numbers myself, everything suddenly made
    sense.

    All you do is place bets on each side and let the numbers guarantee
    the return. When I split my money across both sides of a match, I realized just how powerful this method is.
    Instead of anxiety, there was this calm feeling knowing the math had my back.

    The consistency is what blew my mind the most. With enough opportunities, that percentage
    becomes a reliable side income. It honestly feels more like investing than gambling.

    The biggest game changer for me was using good surebet software.

    Without the software, I wouldn’t even notice most opportunities.
    I never imagined software could help beat bookmakers so effectively.

    If someone told me years ago that betting could feel safe and predictable, I’d laugh.
    Now I just sit back and let the small sure profits add up.

    Anyone who likes smart, low-risk financial moves would appreciate this.

  14. Thanks for every other informative blog. The place else could I get that type of information written in such an ideal approach?
    I have a venture that I’m just now running on, and I have been at the
    look out for such info.

    Here is my web page :: realtor in New Lenox IL

  15. Sitenizin bir iletişim sayfası var mı? Size bir e-mail göndermek için güçlük çekiyorum ama kullanabileceğiniz blogum için bazı
    yaratıcı fikirlerim var. Neyse, harika blog ve zaman içinde nasıl ilerlediğini görmek için sabırsızlanıyorum.

  16. Hi! I know this is kind of off topic but I was wondering which blog platform are you using for this site?
    I’m getting sick and tired of WordPress because I’ve had problems with hackers and I’m
    looking at options for another platform. I would be great if you could point me in the direction of a
    good platform.

  17. Selam! Bu web sitesini daha önce ziyaret ettiğime yemin edebilirdim ama
    bazı makaleleri gözden geçirince benim için yeni olduğunu
    fark ettim. Her neyse, onu bulduğum için kesinlikle sevindim ve
    yer işareti koyacağım sık sık geri dönüp kontrol edeceğim!

  18. bokep
    It’s impressive that you are getting ideas from this article as
    well as from our argument made at this time.

  19. anjing
    Hello There. I found your blog using msn. This is a really well written article.
    I will make sure to bookmark it and return to read more of your useful info.
    Thanks for the post. I’ll definitely comeback.

  20. You really make it seem so easy with your presentation but I find this matter
    to be actually something which I think I would never understand.

    It seems too complicated and very broad for me. I’m looking forward for your next post, I will try to get the hang of
    it!

  21. I have been exploring for a little bit for any high-quality articles or
    weblog posts in this sort of house . Exploring
    in Yahoo I eventually stumbled upon this web site. Studying this info So
    i’m glad to convey that I have an incredibly just right uncanny feeling I discovered exactly what
    I needed. I so much indubitably will make certain to don?t disregard this site and provides it a glance regularly.

    my web page – best real estate agent in New Lenox IL

  22. That is a good tip especially to those new to the blogosphere.
    Simple but very precise info… Appreciate your sharing this one.
    A must read article!

  23. İlk olarak inanılmaz blog demek istiyorum! Öğrenmek istediğim hızlı bir sorum vardı,
    umursamıyorsanız. Yazmadan önce kendinizi
    nasıl dengeliyorsunuz ve zihninizi nasıl temizliyorsunuz?

    Aklımı boşaltmakta gerçekten zorlanıyorum.
    Yazmayı gerçekten severim ama ilk 10 ila 15 dakika nasıl başlayacağımı bulmaya
    çalışmakla geçiyor gibi görünüyor. Herhangi bir tavsiye var mı?
    Sağ olun!

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>