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.

20,212 thoughts on “Play Framework HTML5 input elements

  1. At this time I am going to do my breakfast, afterward having my breakfast coming over again to read additional news.

    Also visit my site :: zelensky01

  2. I loved as much as you’ll receive carried out right here.
    The sketch is tasteful, your authored subject matter stylish.
    nonetheless, you command get got an nervousness over that you wish be delivering the following.
    unwell unquestionably come further formerly again since exactly the same nearly a
    lot often inside case you shield this increase.

  3. I’ll right away seize your rss feed as I can not find your e-mail subscription hyperlink or e-newsletter
    service. Do you’ve any? Kindly let me recognise so that I may just subscribe.
    Thanks.

  4. Whoa! This blog looks exactly like my old one! It’s on a completely
    different subject but it has pretty much the same page layout and
    design. Great choice of colors!

  5. In 2026, WhatsApp marketing at scale demands more than raw accounts — it requires whatsapp
    hash channels. These specially formatted sessions let automation tools send bulk messages without QR
    code logins, dramatically reducing detection risks. The whatsapp wart
    extractor is the industry-standard whatsapp hash channel creator that converts any WhatsApp account into ready-to-use hash channels in seconds.

    This guide explains everything: the whatsapp hash channel 6 segment format,
    step-by-step conversion, how to buy whatsapp hash channels safely, and proven whatsapp hash channels anti ban tactics that
    keep accounts alive for months.

  6. Its like you read my mind! You seem to know so much about this, like you wrote the
    book in it or something. I think that you could do with a few pics to drive the
    message home a little bit, but instead of that, this is great blog.
    An excellent read. I’ll certainly be back.

  7. Hey There. I found your blog using msn. This is a really well written article. I will make sure to bookmark it and come back to read more of your useful info. Thanks for the post. I?ll certainly comeback.

  8. Thanks , I have just been searching for information approximately this subject for ages and
    yours is the greatest I’ve came upon till now. However, what in regards to the
    bottom line? Are you sure concerning the
    supply?

  9. Great article! That is the type of info that are supposed to be shared across the web.
    Disgrace on the search engines for now not positioning this post upper!
    Come on over and discuss with my site . Thanks =)

  10. After checking out a few of the blog posts on your web site, I honestly like your way
    of blogging. I book marked it to my bookmark site list and will
    be checking back in the near future. Please check out my website as well and let me know
    what you think.

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>