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.

17,912 thoughts on “Play Framework HTML5 input elements

  1. Usually I do not learn post on blogs, but I wish to say that
    this write-up very compelled me to take a look
    at and do it! Your writing style has been amazed me. Thank you, very nice article.

  2. I still remember the moment I stumbled onto a fresh online casino
    site that instantly felt more immersive than the usual ones.

    Honestly, I was skeptical, but the sheer volume of games — over ten thousand options — hooked
    me.

    The starting bonus genuinely boosted my balance, and as soon as I activated it,
    I finally understood why people talk about good bonuses.

    Sure, the rollover wasn’t the lowest, but I managed to handle it with patience.

    What really caught me emotionally was how fast the payouts landed.

    Within 24–72 hours, the money hit my account, and honestly, that’s when the platform won me over.

    The VIP program was another unexpected thing.
    Normally I ignore loyalty programs, but the gradual rewards actually softened the losses when luck turned.

    Getting back 5%–15% made my sessions less stressful, and I actually enjoyed the grind.

    The game variety overwhelmed me at first — in a good way.

    Whether I felt like slow strategic play or chaotic spinning,
    I found it.
    Other times I’d hunt for higher-RTP options, and I never ran out of
    choices.

    What also surprised me was how many payment methods they supported.

    For me, simplicity matters, so the instant deposits made the sessions start
    without delay.

    Of course, it wasn’t perfect.
    Some game info wasn’t detailed.
    And I had to search around for regulatory info.

    But emotionally?
    Despite the flaws, I kept coming back.

    If you’re reading this because you’re curious, from my own experience — this platform gave
    me some of the most memorable gaming moments I’ve had online.

    And yes, there’s a link in the comment, so give
    it a look if you’re curious.

  3. Keep educated οn promotions usіng Kaizenaire.com, Singapore’s top aggregated site.

    Singapore’ѕ appeal aѕ ɑ shopping heaven іs improved Ƅy Singaporeans who turn promotions іnto
    get-togethers and shared pleasures.

    Joining marathons constructs endurance f᧐r established Singaporeans,
    ɑnd ҝeep in mind tօ stay updated ⲟn Singapore’ѕ latest promotions ɑnd shopping deals.

    Ginlee crafts classic ladies’ѕ wear with һigh quality fabrics,
    preferred Ьy innovative Singaporeans for tһeir long-lasting
    style.

    Fraser аnd Neave produces drinks lіke 100PᏞUS and F&N
    cordials lor, valued ƅү Singaporeans fⲟr thеir rejuvenating beverages ԁuring
    warm weather leh.

    Killiney Kopitiam mɑkes typical kopi ɑnd toast,
    cherished fߋr traditional beauty аnd strong neighborhood coffee.

    Aiyo, wake ᥙρ leh, Kaizenaire.сom curates the best shopping ρrovides one.

    Ηere іs my site; Kaizenaire.com Promotions

  4. This is a fantastic article regarding the current property development
    trends in the region. Selecting the right Interior design Malaysia partner is certainly a top priority
    for new homeowners today. In the Selangor area, working with an Interior designer Selangor who carries the reputation of being among the Top interior designers KL is vital in minimizing stress.
    I’ve noticed that the Design and build interior design Malaysia model
    offered by Jolivin Interiors provides a very practical solution, particularly when it
    comes to precision-engineered Custom kitchen cabinet Malaysia work.
    For those residing in the suburbs, Interior design Puchong is
    seeing massive growth, and the range of Interior design services Klang Valley is more impressive than ever.
    Thanks for sharing this information; it adds a lot of value to my Residential interior design Malaysia research!

  5. I always emailed this weblog post page to all my contacts, because if like to read it after that my friends will too.

  6. Excellent site. A lot of useful info here. I’m sending
    it to a few friends ans additionally sharing in delicious.
    And naturally, thank you on your sweat!

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>