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.

12,403 thoughts on “Play Framework HTML5 input elements

  1. Почему пользователи выбирают площадку
    KRAKEN?
    Маркетплейс KRAKEN заслужил доверие многочисленной аудитории благодаря сочетанию ключевых факторов.
    Во-первых, это широкий и разнообразный ассортимент, представленный сотнями продавцов.
    Во-вторых, интуитивно понятный интерфейс KRAKEN, который упрощает навигацию, поиск товаров и управление заказами даже
    для новых пользователей. В-третьих, продуманная система безопасных транзакций, включающая механизмы разрешения споров (диспутов) и возможность использования условного
    депонирования, что минимизирует риски
    для обеих сторон сделки. На
    KRAKEN функциональность сочетается с внимательным
    отношением к безопасности клиентов, что делает процесс
    покупок более предсказуемым, защищенным и, как следствие,
    популярным среди пользователей, ценящих анонимность и надежность.

  2. Having read this I believed it was very informative.
    I appreciate you spending some time and effort
    to put this information together. I once again find myself spending way too much time
    both reading and commenting. But so what, it was still
    worth it!

  3. Whats up are using WordPress for your blog platform?
    I’m new to the blog world but I’m trying to get started and set up my own. Do you require any html coding knowledge to make your own blog?
    Any help would be greatly appreciated!

  4. Howdy! Would you mind if I share your blog with my myspace
    group? There’s a lot of people that I think would really appreciate your content.
    Please let me know. Many thanks

  5. Ɗo you have a spam problem on this blog; I aⅼso
    am a bloցger, annd I was curious about your situаtion; we hɑve developed some nice praⅽtices and we are looking too trade strategies with other folks, bbе sure to
    sshoot me an e-maiⅼ іf intereѕtеd.

    Here is my blg post :: mb66 ทางเข้า, Valentina,

  6. Howdy just wanted to give you a quick heads up. The words in your article seem to be running off the screen in Safari.
    I’m not sure if this is a format issue or something to do with browser compatibility but I thought I’d post to let you know.
    The layout look great though! Hope you get the problem fixed soon. Many thanks

  7. I feel this is one of the such a lot important information for me.

    And i am happy studying your article. However want to remark on some basic issues, The site style is wonderful, the articles is in reality nice :
    D. Just right process, cheers

  8. Heya i am for the primary time here. I came across this
    board and I to find It truly helpful & it helped me out much.

    I am hoping to offer one thing again and aid others such as you aided me.

  9. Hello There. I found your weblog the use of msn. That is an extremely smartly written article.

    I will make sure to bookmark it and come back
    to learn extra of your useful info. Thanks for the
    post. I will definitely comeback.

  10. With havin so much content do you ever run into any problems of plagorism or
    copyright violation? My site has a lot of completely unique content
    I’ve either authored myself or outsourced but it seems a lot of it is popping it up
    all over the internet without my authorization. Do you know any solutions to help prevent content from being ripped off?
    I’d truly appreciate it.

  11. Hi, the whole thing is going perfectly here and ofcourse
    every one is sharing facts, that’s actually good, keep up writing.

  12. Suka tantangan jackpot? AGENJITU303 punya koleksi toto
    slot & casino paling gacor bikin puas. Cukup 1 ID, main semua pasaran. Buruan raih hokinya sekarang!

  13. Hey! I know this is kinda off topic however ,
    I’d figured I’d ask. Would you be interested in exchanging links
    or maybe guest authoring a blog article or vice-versa?
    My blog discusses a lot of the same subjects
    as yours and I think we could greatly benefit from each other.

    If you’re interested feel free to shoot me
    an e-mail. I look forward to hearing from you!
    Excellent blog by the way!

  14. Hey there! This post could not be written any better!
    Reading this post reminds me of my previous room mate!

    He always kept talking about this. I will forward this post to him.
    Fairly certain he will have a good read. Many thanks for sharing!

  15. Definitely imagine that that you said. Your favorite reason seemed
    to be at the net the easiest thing to keep in mind of.
    I say to you, I certainly get irked even as other folks consider
    concerns that they plainly do not realize about.
    You controlled to hit the nail upon the highest and defined out
    the entire thing with no need side-effects , people can take a signal.
    Will likely be again to get more. Thanks

  16. Undeniably consider that which you said. Your favorite justification appeared to be on the
    net the simplest thing to consider of. I say
    to you, I certainly get annoyed while folks consider worries
    that they plainly don’t recognise about. You managed to hit
    the nail upon the top and defined out the entire thing with no need side-effects , other people can take
    a signal. Will probably be again to get more. Thank
    you

  17. Wonderful post however , I was wanting to know if you could write a litte
    more on this subject? I’d be very thankful if you could elaborate a little bit further.
    Thanks!

  18. Terrific work! That is the type of information that are meant to be shared
    around the net. Shame on Google for now not
    positioning this publish higher! Come on over and consult with my web site .
    Thank you =)

  19. Very quickly this web page will be famous amid all blogging and site-building
    users, due to it’s pleasant articles

  20. Aw, this was an incredibly nice post. Spending some time and actual effort to
    produce a good article… but what can I say… I hesitate a lot and never manage to get anything done.

  21. Incredible! This blog looks just like my old one! It’s on a entirely different subject but it has pretty much the same layout and design. Outstanding choice of colors!

  22. When I originally commented I clicked the “Notify me when new comments are added”
    checkbox and now each time a comment is added I get several emails
    with the same comment. Is there any way you can remove me from that service?
    Many thanks!

  23. Hey there! Someone in my Myspace group shared this site
    with us so I came to look it over. I’m definitely enjoying the information. I’m book-marking and will be tweeting this
    to my followers! Superb blog and great style and design.

  24. This design is spectacular! You definitely know how to keep
    a reader entertained. Between your wit and your videos, I was
    almost moved to start my own blog (well, almost…HaHa!)
    Great job. I really loved what you had to say, and more than that,
    how you presented it. Too cool!

  25. I really like your blog.. very nice colors & theme. Did
    you make this website yourself or did you hire someone to do it for you?
    Plz answer back as I’m looking to create my own blog and would like to know where u got this
    from. kudos

  26. For the reason that the admin of this web page is working, no uncertainty very shortly it will be
    renowned, due to its feature contents.

  27. Irecently wrote about how Jane decided to try Paybis to move her money from her bank into crypto and then straight into her trading account, and honestly, her whole story turned
    out way more fun than anyone thought.

    Jane isn’t your regular crypto newbie. Funny thing —
    she collects tiny vintage globes and has exactly 27 of them lined up
    behind her desk. Another fun fact is that she can solve a Rubik’s cube in under 40 seconds.

    So when she discovered Paybis, she approached it with the same energy — fast,
    efficient, and determined.

    She said, she wanted a platform that wouldn’t “fight her back,” because her bank is already stressful
    enough. Paybis ended up being perfect: super user-friendly
    onboarding, easy deposit, and she was able to convert her bank funds into crypto in literally minutes.
    Jane even joked it was easier than ordering sushi.

    Once the crypto hit her wallet, she jumped straight into her trading platform — no delays.
    And because she’s Jane, she turned it into a personal
    speed-challenge. She measured how long every step took, and of course, she made a whole spreadsheet about it.
    Little detail: she names her spreadsheets after
    planets.

    What surprised her most was how Paybis didn’t overwhelm her with
    complicated menus. She likes things simple — after all, she once returned
    a coffee machine because it had “too many buttons.” So the clean process from bank → crypto → trading felt like a win.

    She casually dropped that anyone wanting to try the same flow should
    check the link inside this comment, but she didn’t want to make a big deal
    of it. Just said it might be helpful.

    Overall, Jane’s whole experience using Paybis was refreshingly easy, surprisingly fun, and very “Jane-style” — structured, quirky, and
    full of little experiments.

    For anyone interested, she said the link in the comment explains everything a bit deeper,
    but that’s totally optional.

  28. Hey, I think your site might be having browser compatibility issues.
    When I look at your blog site in Safari, it looks fine but when opening
    in Internet Explorer, it has some overlapping.
    I just wanted to give you a quick heads up! Other then that,
    amazing blog!

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

    Fantastic work!

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

  31. My developer is trying to convince me to move to .net from PHP.

    I have always disliked the idea because of the expenses.
    But he’s tryiong none the less. I’ve been using Movable-type on several websites
    for about a year and am nervous about switching to another
    platform. I have heard great things about blogengine.net.

    Is there a way I can transfer all my wordpress posts into it?
    Any kind of help would be really appreciated!

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>