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

  1. I enjoy what you guys are usually up too. This kind of clever work and coverage!

    Keep up the very good works guys I’ve incorporated you
    guys to blogroll.

  2. Hello just wanted to give you a brief heads up and let you know a few of the pictures
    aren’t loading correctly. I’m not sure why but I think its a linking issue.
    I’ve tried it in two different web browsers and
    both show the same outcome.

  3. When someone writes an post he/she keeps the plan of a user in his/her
    brain that how a user can understand it. Thus that’s why this article is perfect.
    Thanks!

  4. 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?
    Thanks!

  5. Hello, its fastidious post on the topic of media print,
    we all be familiar with media is a enormous source of data.

  6. Hey! I know this is kinda 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 issues 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.

  7. Terrific article! That is the kind of info that are supposed to be shared around the net.

    Disgrace on the seek engines for not positioning this submit upper!

    Come on over and visit my website . Thanks =)

  8. Hi there, I wish for to subscribe for this webpage to obtain newest updates,
    therefore where can i do it please assist.

    Stop by my web page … paktoto

  9. В Турции квартиры маркируются
    системой X+1: 1+1 — это одна спальня и гостиная
    с кухней. Типичная площадь 3+1 — 110–160 м².

    Цены в 2026 году варьируются от
    1 200 € в Алании. Бюджетные — Паяллар и Авсаллар.
    Премиум — центральный Стамбул.

    Выбор предложений: web site.
    Сотни квартир с полной документацией — от студий до
    пентхаусов.

  10. It’s remarkable in favor of me to have a site, which is beneficial designed for my
    experience. thanks admin

  11. Hi would you mind letting me know which webhost you’re using?

    I’ve loaded your blog in 3 different internet browsers and I must say this blog loads a lot faster then most.
    Can you suggest a good hosting provider at a fair price?

    Kudos, I appreciate it!

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

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

  13. Wow, wonderful blog layout! How long have you been blogging for?
    you make blogging look easy. The overall look of your site is fantastic, as well as the content!

  14. constantly i used to read smaller articles which also clear their motive, and that is also happening
    with this post which I am reading here.

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

    Thanks a lot!

  16. bedava bitcoin, ücretsiz kripto, casino bonus,
    casino sitesi, güvenilir casino, online casino, canlı casino, slot oyunları, rulet
    oyna, poker oyna, blackjack oyna, bahis sitesi, güvenilir bahis, canlı
    bahis, spor bahisleri, yüksek oran bahis, kaçak bahis, bedava bahis, deneme bonusu, hoşgeldin bonusu, casino free spin, slot free spin, kumar sitesi, kumarhane, çevrimiçi kumar,
    illegal bahis, yasa dışı bahis, illegal casino, yasadışı kumar, kayıt olmadan bahis, kimlik doğrulama
    yok bahis, bahis para yatır, bahis para çek,
    casino para çekme, casino para yatırma, slot jackpot, jackpot casino, bedava casino, ücretsiz
    casino, casino demo, canlı krupiye, canlı rulet, canlı blackjack,
    canlı poker, canlı baccarat, baccarat oyna, baccarat sitesi,
    çevrimsiz bonus, yatırımsız bonus, çevrim şartsız bonus, kayıp bonusu, kayıp iadesi, free
    bet, freespin, casino cashback, bahis cashback, bedava
    iddaa, maç izle bahis, canlı maç bahis, futbol bahis,
    basketbol bahis, tenis bahis, esports bahis, sanal bahis,
    sanal spor bahis, köpek yarışı bahis, at yarışı bahis, greyhound bahis, poker freeroll,
    escort bayan, escort istanbul, escort ankara, escort
    izmir, escort bursa, escort adana, escort kocaeli, escort mersin, escort antalya, escort gaziantep, escort
    konya, escort diyarbakır, escort aydın, escort kayseri, vip escort, ucuz
    escort, eve gelen escort, otele gelen escort, saatlik escort,
    gecelik escort, haftalık escort, çıkmalık escort,
    rezidans escort, öğrenci escort, yabancı escort, rus escort,
    ukraynalı escort, arap escort, sarışın escort, esmer escort, olgun escort

  17. It’s really a nice and useful piece of info. I am glad that you
    just shared this helpful information with us.

    Please stay us informed like this. Thank you for sharing.

  18. Hello! I know this is somewhat off topic but I was wondering which blog platform are you using for this website?
    I’m getting fed up of WordPress because I’ve had issues with hackers and I’m looking at
    options for another platform. I would be awesome if you could point me in the direction of a good platform.

    My web blog … bodybuilding supplements

  19. I am not sure where you are getting your information, but great
    topic. I needs to spend some time learning more or
    understanding more. Thanks for excellent info I was
    looking for this information for my mission.

  20. Премиум монтаж кондиционеров в коттеджах и на Крестовском.
    Работаем с VRF скрытого типа.

    Сертифицированный сервис по установке Electrolux в СПб.
    Только качественный крепеж и трасса «в утепле».

    даже в время белых ночей — выезжаем каждый день по всему СПб и области (до Пушкина бесплатно).

  21. If you are going for finest contents like myself, simply visit this website every day as it gives quality contents, thanks

  22. Thank you for the good writeup. It in fact was a amusement
    account it. Look advanced to far added agreeable from you!
    By the way, how can we communicate?

  23. Hi there, I found your web site by means of Google whilst looking for a comparable topic,
    your site got here up, it looks great. I’ve bookmarked it in my google bookmarks.

    Hello there, simply become alert to your weblog via Google, and found that it is really informative.

    I am going to watch out for brussels. I will appreciate in the event
    you continue this in future. A lot of folks will probably be benefited from your writing.
    Cheers!

  24. I’ve been surfing online more than three hours today,
    yet I never found any interesting article like yours. It’s pretty worth enough for me.
    In my opinion, if all webmasters and bloggers made good content as
    you did, the web will be a lot more useful than ever before.

  25. hi!,I love your writing very much! proportion we keep in touch extra about your post on AOL?
    I need a specialist on this space to solve my problem.

    Maybe that is you! Taking a look ahead to peer you.

  26. hi!,I really like your writing very a lot!
    share we be in contact extra about your article on AOL?
    I need an expert in this house to solve my problem. May be that is you!
    Looking forward to look you.

  27. Really when someone doesn’t know after that its up to other people that they will help,
    so here it happens.

  28. Hi there, just became aware of your blog through Google, and found that it is truly informative.
    I am going to watch out for brussels. I will be grateful if you continue this in future.
    Numerous people will be benefited from your writing. Cheers!

  29. Thank you for another informative site. Where else may I get that kind of info
    written in such an ideal means? I have a venture that
    I’m just now working on, and I’ve been at the look out for such info.

  30. You really make it seem really easy with your presentation but I find this topic to
    be actually something which I feel I might by no means understand.

    It kind of feels too complex and very wide for me. I’m having a look ahead in your subsequent put up, I’ll attempt to get the dangle of it!

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>