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,492 thoughts on “Play Framework HTML5 input elements

  1. Hello there, You’ve done an excellent job. I will certainly digg it and personally suggest to my friends.
    I am sure they’ll be benefited from this web site.

  2. I’m extremely pleased to discover this great site.
    I want to to thank you for ones time for this wonderful read!!
    I definitely enjoyed every bit of it and I have you book-marked to
    look at new information on your site.

  3. Howdy just wanted to give you a quick heads up. The words in your article seem to
    be running off the screen in Opera. I’m not sure if this is a formatting
    issue or something to do with browser compatibility but
    I figured I’d post to let you know. The layout look great
    though! Hope you get the issue resolved soon. Kudos

  4. Admiring the time and effort you put into your website and detailed information you provide.
    It’s nice to come across a blog every once in a while that isn’t
    the same outdated rehashed information. Great read!
    I’ve saved your site and I’m including your RSS feeds
    to my Google account.

  5. Hmm is anyone else experiencing problems with the pictures on this blog loading?
    I’m trying to determine if its a problem
    on my end or if it’s the blog. Any feedback would be greatly appreciated.

  6. Amazing blog! Is your theme custom made or did you download it from somewhere?
    A design like yours with a few simple tweeks would really make my
    blog stand out. Please let me know where you got your theme.
    Kudos

  7. I am curious to find out what blog system you’re utilizing?

    I’m experiencing some small security issues with my
    latest website and I would like to find something more
    safe. Do you have any suggestions?

  8. Почему пользователи выбирают площадку KRAKEN?

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

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

    На KRAKEN функциональность
    сочетается с внимательным отношением к
    безопасности клиентов, что делает процесс покупок более
    предсказуемым, защищенным и, как следствие, популярным среди пользователей, ценящих анонимность и надежность.

  9. Nice weblog here! Additionally your site quite a bit up fast!
    What host are you the usage of? Can I get your associate hyperlink on your host?
    I wish my web site loaded up as quickly as
    yours lol

  10. Anxious-preoccupied individuals may over-communicate out of captivity more
    times than I’ve had hot dinners. On Ubuntu 18.04 with a Dockerfile.
    Storing digital photos read on preserving photos read on to find
    out How his old friend.

  11. always i used to read smaller articles that also clear their motive, and that is also happening with this paragraph which I am reading at this place.

  12. Hey! This post couldn’t be written any better!
    Reading this post reminds me of my old room mate! He always kept talking
    about this. I will forward this page to him.

    Pretty sure he will have a good read. Many
    thanks for sharing!

  13. Fastidious response in return of this issue with genuine arguments and explaining the whole thing about that.

  14. Hello! I know this is kind of off topic but I
    was wondering which blog platform are you using for this site?

    I’m getting tired of WordPress because I’ve had issues 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.

  15. Hey there would you mind letting me know which hosting company you’re
    working with? I’ve loaded your blog in 3 completely
    different internet browsers and I must say this blog
    loads a lot faster then most. Can you suggest a good internet hosting provider at a reasonable price?
    Thank you, I appreciate it!

  16. Attractive section of content. I just stumbled
    upon your weblog and in accession capital to assert that I acquire actually enjoyed account your blog posts.
    Any way I will be subscribing to your augment and even I achievement you
    access consistently rapidly.

  17. Hi, all is going sound here and ofcourse every one is sharing facts, that’s genuinely good,
    keep up writing.

  18. After I initially commented I appear to have clicked on the -Notify me
    when new comments are added- checkbox and now every time a comment is added I get 4 emails with the exact same comment.
    There has to be a way you are able to remove me from that service?
    Kudos!

  19. Greetings from Florida! I’m bored to tears at work so I decided to check out
    your blog on my iphone during lunch break. I love the info
    you present here and can’t wait to take a look when I get home.

    I’m amazed at how fast your blog loaded on my phone .. I’m
    not even using WIFI, just 3G .. Anyways, good blog!

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

  21. KL108 menyediakan akses Login Situs Game Online Anti Blokir
    2026 dengan berbagai macam permainan menarik.

    KL108 hadir sebagai situs game online anti blokir terbaru di tahun 2026 yang dirancang
    khusus untuk memberikan akses stabil, cepat, dan aman bagi para pemain di Indonesia.

  22. Good post however , I was wondering if you could write a litte more on this topic?

    I’d be very grateful if you could elaborate a little bit more.
    Kudos!

  23. I know this web page gives quality depending articles and additional
    stuff, is there any other web page which presents these things in quality?

  24. Heya i am for the first time here. I found this board
    and I find It truly useful & it helped me out much. I hope to give something back and aid others like you helped me.

  25. Hello there! Would you mind if I share your blog with my zynga group?
    There’s a lot of people that I think would really enjoy your
    content. Please let me know. Thank you

  26. SAP Analytics Cloud is a fresh technology cloud-primarily based software that assists you investigate your data, handles visualization and analysis, develop
    money ideas, and make predictive forecasting. It is a a person-cease-shop
    Remedy to manage with the analytic needs and comprises
    small business intelligence, scheduling, predictive analytics, and
    governance and hazard. The applying is designed over the
    SAP Cloud System and delivers fantastic effectiveness and scalability.

    handles how on the on-premise SAP HANA, SAP BW, and S/4HANA sources, you are able to work with information from an array
    of non-SAP resources, such as Google Drive, Salesforce, SQL Server, Concur, and CSV, to name a handful
    of. SAP Analytics Cloud lets you make protected connections to those cloud and on-premise info sources.

    sap analytics cloud ppt,,sap analytics cloud logo, sap analytics cloud
    online training, sap analytics cloud online tutorial, sap analytics cloud certification course, sap sac training

  27. Hello there! I could have sworn I’ve been to this website
    before but after going through some of the posts I realized it’s new to me.
    Anyways, I’m certainly pleased I stumbled upon it and I’ll be book-marking it and checking back frequently!

  28. Почему пользователи выбирают площадку KRAKEN?

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

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

  29. Greetings! Very useful advice within this article!

    It is the little changes which will make the most important changes.
    Thanks for sharing!

  30. I blog frequently and I truly thank you for your content. The article has truly peaked my interest.
    I’m going to take a note of your site and keep checking
    for new details about once per week. I subscribed to your Feed too.

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>