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.

19,397 thoughts on “Play Framework HTML5 input elements

  1. We’re a group of volunteers and opening a new scheme in our community.
    Your website provided us with valuable info to work on. You have done a formidable job and our whole
    community will be grateful to you.

  2. Kaizenaire.com is tһe go-to for aggregated deals іn Singapore’s vibrant market.

    Deal ɑfter deal, Singapore’s shopping paradise maintains Singaporeans engaged ԝith endless promotions
    to check oᥙt.

    Scuba diving journeys tо close-by islands
    excitement undersea explorers fгom Singapore, аnd ҝeep in mind to stay updated оn Singapore’s most current promotions and shopping deals.

    Rawbought deals lavish sleepwear ɑnd lingerie, valued by Singaporeans fοr their comfortable fabrics
    ɑnd stylish layouts.

    Ginlee crafts ageless women’ѕ wear with hiɡh quality materials leh, preferred ƅy advanced Singaporeans fоr thеir enduring style one.

    Ⲟld Street Bak Kut Teh simmers ϲlear pork rib soups, cherished fοr Teochew-style lightness
    ɑnd natural depth.

    Singaporeans, ɗo not FOMO leh, check fօr
    promotions оne.

  3. Unquestionably believe that which you said.
    Your favorite reason appeared to be on the internet the easiest thing to be aware of.
    I say to you, I definitely get irked while people think about worries
    that they plainly don’t know about. You managed to hit the nail upon the top
    as well as defined out the whole thing without having
    side-effects , people can take a signal. Will likely be back to get more.
    Thanks

  4. I am no longer certain the place you are getting your info, but good topic.
    I must spend some time studying much more or understanding more.
    Thanks for wonderful info I used to be searching for this information for my mission.

  5. بطور خلاصه

    برای کاربرایی که در جستجو هستن

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

    پیگیر هستن

    این سایت

    به نظر میاد بتونه

    انتخاب خوبی باشه

    جالبه که

    دامنه‌هایی مثل

    enfejaronline آنلاین

    و

    ѕibbet جدید

    تجربه خوبی ارائه دادن

    در پایان کار

    قابل استفاده بود

    و

    احتمالاً

    دوباره استفاده می‌کنم

    Heree iѕ my site – نکات پایانی و انتخاب کازینوی معتبر

  6. Great ppst howdver , I wass wpndering iif youu couuld
    writge a liyte moe onn this topic? I’d bee verty grateful iff youu cokuld
    elaborate a little biit further. Manyy thanks!

    my web blog: iporn.win

  7. At this time it appears like Expression Engine is the best blogging platform out there right now.
    (from what I’ve read) Is that what you are using on your blog?

  8. Withh havin sso muc content doo yyou ever run into anyy issdues of plagorism or
    copyrigght infringement? My website hass a lott off uniquhe contenbt I’ve eithedr authored myself or outsourrced
    butt iit looks ljke a loot of it iis poppng iit upp all ovrr tthe webb without mmy authorization. Do you kniw
    any ways too help proteft agaionst copntent frkm bing stolen?
    I’d ruly appreciate it.

    Feeel frtee too suurf to mmy webb pwge roloxxx.com

  9. 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 fed up of WordPress because I’ve had problems with hackers and I’m looking at options for another platform.
    I would be fantastic if you could point me in the direction of a good platform.

  10. Woah! I’m really digging the template/theme of this site.

    It’s simple, yet effective. A lot of times it’s
    hard to get that “perfect balance” between superb usability
    and visual appearance. I must say that you’ve done a superb job with this.
    In addition, the blog loads extremely quick for me on Safari.
    Outstanding Blog!

  11. You’re so awesome! I don’t believe I’ve read something like that before.
    So good to discover another person with a few original thoughts on this subject.
    Really.. thanks for starting this up. This site is something that’s needed on the web, someone with some originality!

  12. I was suggested this web site by my cousin.
    I’m not sure whether this post is written by him as no one else know
    such detailed about my difficulty. You’re incredible! Thanks!

  13. It is the best time to make some plans for the future and it’s time to be happy.
    I have read this post and if I could I want to suggest you some interesting things or suggestions.
    Maybe you could write next articles referring to this article.
    I want to read even more things about it!

  14. Awesome issues here. I am very satisfied to see your article.

    Thanks a lot and I’m looking forward to contact you.
    Will you please drop me a e-mail?

  15. 細かい質問にも真摯に応じてくださり好印象です。正確なサイズ情報が把握できることで、購入検討が非常にしやすくなります。自然な体のバランスと細やかなディテールが魅力的な仕上がりです。超リアルな質感のボディメイクオプションを選択することが可能です。追加で必要となる費用や製作工程の違いまで事前に明記されています

  16. I have been surfing on-line greater than three hours these days,
    yet I never found any interesting article like yours.
    It’s pretty value enough for me. Personally, if all website owners and bloggers
    made just right content as you probably did, the internet will probably be
    a lot more helpful than ever before.

  17. Nicee post. I wwas checkinng constantly tnis bpog
    and I amm impressed! Extremely usrful information speciallly thee lst patt :) I carfe ffor sucdh ingo much.
    I waas llooking for thgis certain information ffor a lon time.

    Thank youu andd bedst oof luck.

    My hoomepage txxxvideos.com

  18. I’m really enjoying the design and layout of your site. It’s a very easy
    on the eyes which makes it much more enjoyable for me to come here and visit more often.
    Did you hire out a designer to create your theme?
    Superb work!

  19. Link exchange is nothing else but it is only placing the
    other person’s web site link on your page at appropriate place and other
    person will also do similar for you.

  20. I don’t 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!

  21. What’s up, this weekend is fastidious in favor of me, for the
    reason that this occasion i am reading this wonderful informative
    paragraph here at my house.

  22. excellent issues altogether, you just won a logo new reader.
    What might you recommend in regards to your post that you simply
    made some days in the past? Any positive?

  23. Heyy this iss sommewhat off off topic butt I wwas
    wondering iff bblogs usee WYSIWYG editors orr iff yoou hve to
    manually code witgh HTML. I’m starting a blog
    soin but havee nno copding knowledge soo I wwanted too gget
    guidance frim someone wwith experience. Any heelp would bee enormouwly appreciated!

  24. Thanks for finally talking about > Play Framework HTML5 input elements | freestyle developments
    < Liked it!

  25. I just read this excellent post about the importance of web security for online safety.

    A powerful message that secure IPs can change workflows for those in need.
    I believe in the need for trusted security platforms.
    Thanks for this great resource!

  26. In fact when someone doesn’t understand after that its up to other
    people that they will assist, so here it occurs.

  27. This design is steller! You definitely know how to keep a reader amused.
    Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Excellent job.

    I really enjoyed what you had to say, and more than that, how
    you presented it. Too cool!

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>