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.

15,209 thoughts on “Play Framework HTML5 input elements

  1. Nice post. I learn something new and challenging on websites
    I stumbleupon every day. It will always be exciting to read through content from other authors and practice something from other sites.

  2. Wow, fantastic weblog structure! How long have you been blogging for?

    you make running a blog glance easy. The total look of your web site is wonderful, let alone the content!

  3. Жильё в Турции обозначаются формулой «спальни плюс гостиная»:
    3+1 — три спальни и общая зона.

    Средний метраж 1+1 — 45–65 м².

    Цены в 2026 году варьируются от 1
    200 € в Алании. Самые доступные — Мерсин и
    Трабзон. Топ-локации — центральный
    Стамбул.

    Поиск объектов: купить квартиру за границей.
    Все варианты с полной документацией —
    в любом бюджете.

  4. 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 certainly you’re going to a famous blogger if
    you are not already ;) Cheers!

  5. This is a helpful post about online casinos. I appreciate
    how you explained the importance of choosing reliable sites.

    From what I’ve seen, ufabet888 are often recommended
    because they provide consistent service and fast withdrawals.

    Many users have trouble to find trustworthy platforms, so content like this
    is very helpful.

    Thanks for sharing — this will definitely help beginners choose better platforms.

  6. This is a very informative post about online
    casinos and betting platforms. I especially liked how it explains the importance of choosing
    a trusted site before registering.

    Many players often ask where to find reliable gaming platforms with fair odds and smooth withdrawals.
    In my experience, checking platforms like milyon88games.com
    helps users understand what features to look for in a legit online casino.

    Thanks for sharing these insights — they’re useful for both beginners and experienced players.

  7. I was reading an interesting article about Paybis and honestly I didn’t
    expect much at first but it impressed me.
    The article talked about how digital finance is evolving, and it actually made sense.

    After reading it, I recommended it to my family member, and he decided
    to explore it. Within the next month, he started managing his money differently.

    He didn’t just sit around — he took action. Eventually,
    he got close to 150k in results — not overnight, but
    through consistency.
    What surprised me most is how his lifestyle
    changed. He even upgraded his lifestyle,
    something like a Mercedes-Benz C-Class, and became more confident.

    He even met someone new who shares his lifestyle.
    This isn’t magic or guaranteed, but the story is true from what
    I’ve seen, and that article definitely changed the way we look at money.

    There’s actually a way to check it out here, and I’d seriously suggest reading it.

    Sometimes one good article can shift your mindset.

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>