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

  1. Dive deep іnto curated promotions with Kaizenaire.сom, the top site for Singapore.

    The energy of Singapore ɑs a shopping heaven matches perfectly ᴡith locals’ love f᧐r
    snagging promotions and deals.

    Holding dinner suppers reinforces bonds ɑmong sociable Singaporeans, ɑnd
    remember to гemain upgraded οn Singapore’s most reⅽent promotions аnd shopping deals.

    Watsons ߋffers health аnd beauty products, enjoyed ƅy Singaporeans fоr thеir ⅼarge selection оf skin care and wellness items.

    SATS tɑkes care of aviation ɑnd food options ⲟne, appreciated by Singaporeans for their in-flight food catering and ground
    handling effectiveness mah.

    Stuff ‘ԁ loads burritos аnd kebabs with fresh components, adored bʏ
    residents for delicious, mobile combination eats.

    Aunties enjoy іt leh, Kaizenaire.com updates witһ valսе-packed deals օne.

  2. of course like your website however you
    need to test the spelling on quite a few of your posts.
    Several of them are rife with spelling issues and I to find it
    very troublesome to tell the truth then again I’ll surely come back again.

  3. Excellent post. I was checking continuously this weblog and I am inspired!
    Very helpful information specifically the closing section :
    ) I handle such info a lot. I used to be looking for this certain information for
    a long time. Thank you and best of luck.

  4. Somebody necessarily assist to make seriously posts
    I would state. This is the very first time I frequented your website
    page and thus far? I amazed with the analysis you made to make this actual post amazing.
    Excellent process!

  5. I have been browsing online more than 3 hours these days, but
    I never discovered any fascinating article like yours. It is
    pretty worth sufficient for me. In my view, if all webmasters and bloggers made good content
    material as you probably did, the internet shall be a lot more helpful than ever
    before.

  6. Link exchange is nothing else but it is only
    placing the other person’s blog link on your page at suitable place
    and other person will also do same for you.

  7. Oh my goodness! Incredible article dude! Many thanks, However
    I am going through troubles with your RSS. I don’t understand the
    reason why I cannot subscribe to it. Is there anybody
    getting similar RSS issues? Anyone who knows the answer can you kindly respond?
    Thanks!!

  8. I love your blog.. very nice colors & theme. Did you create
    this website yourself or did you hire someone to do it for you?
    Plz reply as I’m looking to design my own blog
    and would like to find out where u got this from. kudos

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

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

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

  10. Magnificent beat ! I wish to apprentice while you amend your web site, how can i subscribe for a blog site? The account aided me a acceptable deal. I had been a little bit acquainted of this your broadcast offered bright clear idea

  11. Hey there! This is my 1st comment here so I just wanted to give a quick shout out and tell you I genuinely enjoy reading through your posts.
    Can you recommend any other blogs/websites/forums that cover the same subjects?
    Thank you!

  12. There’s a piece of my life I rarely talk about after my dad walked out of our
    home.

    We lived in a quiet Berlin neighborhood and our house used to mean warmth.
    But when the bills started to overflow, our security faded
    away. We tried to hold on, but in the end, we had no other choice but to give up our home.

    I’ll never forget the sound of my mom quietly crying in the living room.
    I knew I couldn’t just sit there.

    So I started reading everything I could online.
    That’s when I came across stories of people using cryptocurrencies and converting them safely into money through trusted platforms.

    I told my mother she could explore that—because I needed
    her to believe we had options. She looked into it,
    researched for days, and eventually chose Paybis (Paybis).
    She said it felt straightforward enough for her to
    try.

    Her voice trembled when she whispered “I hope this works”.

    When it went through, she looked at me with the softest smile.

    From that moment, the pressure eased just a little. My mom handled everything herself, but she always said
    my encouragement gave her courage.

    I discovered that small ideas can change everything.

    Today, we’re far from perfect, but we’re no longer drowning.
    And every time my mom looks at me and smiles, she reminds me how everything changed the day she
    found the strength to use Paybis to convert her crypto into something we could
    actually live on.

    I’ll never forget how far we’ve come.

  13. At this time it looks like Movable Type is the top blogging platform out there right now.
    (from what I’ve read) Is that what you’re using on your blog?

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>