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

  1. 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.

  2. Greeat bet ! I woyld like tto apprentice evedn aas youu amend yojr wweb site, howw ccan i subscrkbe
    for a weblog site? Thee afcount aifed mme a appropriate deal.
    I hav been tiny bitt cquainted oof tyis your broadcast proided vjbrant transparent
    idea

  3. I’m really impressed with your writing skills as well
    as with the layout on your weblog. Is this a paid theme
    or did you customize it yourself? Anyway keep up the excellent quality writing, it
    is rare to see a nice blog like this one these days.

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>