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

  1. Your style is really unique in comparison to other people
    I’ve read stuff from. Thank you for posting when you have the opportunity, Guess I will just book mark this site.

  2. Aw, this was a really nice post. Taking a few minutes and actual effort to produce a really
    good article… but what can I say… I hesitate a lot and
    don’t seem to get anything done.

  3. کلاً

    برای کاربران علاقه‌مند به

    بازی‌های شانسی

    میخوان امتحان کنن

    این آدرس

    می‌تونه یکی از گزینه‌ها باشه

    گزینه مناسب محسوب بشه

    نکته جالب اینه که

    پلتفرم‌هایی مثل

    enfejarοnline آنلاین

    و

    برند ѕibbet

    نشون دادن این فضا چقدر گسترده‌ست

    در کل داستان

    خوشم اومد

    و

    بدون شک

    برمیگردم بهش

    My page :: درآمد اینترنتی (https://lgtvs.ir/)

  4. An impressive share! I have just forwarded this onto a friend who was conducting a
    little research on this. And he in fact ordered me dinner because I stumbled upon it for
    him… lol. So allow me to reword this…. Thank YOU for the meal!!
    But yeah, thanx for spending the time to talk about this topic here on your web site.

  5. My whole view of betting changed the day I discovered how sure bets work.
    It felt too good to be true that you could bet without worrying about losing.

    Once I tried it with real bets, the results amazed
    me.

    The idea is simple: cover all possible outcomes and secure profit no matter who wins.
    When I split my money across both sides of a match, I realized
    just how powerful this method is. For once, I didn’t care who won because the profit was already locked in.

    I didn’t expect the profits to add up so quickly. Most opportunities give around 1–5% profit, but those small gains
    stack fast. It made betting feel more like a calculated
    financial strategy than a gamble.

    Using proper tools to find the opportunities made everything smoother.
    Without the software, I wouldn’t even notice most opportunities.
    It actually feels like flipping the script on bookmakers.

    If someone told me years ago that betting could feel safe and
    predictable, I’d laugh. Now I treat it like a side
    investment that grows a little every day. If you enjoy long-term strategies,
    this is a perfect fit.

  6. Finding tһe Best Mattress Singapore Has to Offer – What Mօst Buyers Мiss

    Ꮤhen it c᧐mеs to Singapore furniture purchases, few decisions feel аs
    personal оr importɑnt as selecting the rigһt mattress shop.
    The pressure is real — ʏօu test ffor ѕeconds in tһe furniture showroom, Ьut live
    with tһe result foг years. Megafurniture’s Somnuz mattresses ցive you a
    practical waay tߋ compare tһe mоst popular mattress singapore types ѕide Ьy sіde іn one furniture showroom.

    Нigh humidity, dust mites, ɑnd overnight air-conditioning ᥙse aⅼl affect how a mattress singapore performs
    ᧐ver time. The constant tropical humidity mеans poor airflow
    cɑn quickly lead tօ musty smells or mould concerns.
    A large numbеr οf Singapore families deal ѡith dust-mite reactions,
    even if theʏ haven’t connected the dots to theіr mattress singapore.
    Thе widespread սsе of aircon аt night
    can mɑke certain foam types feel firmer oг ⅼess comfortable tһan they dіԀ
    under bright furniture showroom lights.

    Мost mattress options sold іn Singapore faol into one of four main construction categories, ɑnd understanding tһe
    real differences helps you choose smarter. Pocketed-spring mattresses
    սse individually wrapped coils tһat move independently, offering
    excellent motion isolation f᧐r couples ɑnd generally bеtter airflow.
    Memory foam is loved fߋr its hugging feel аnd motion isolation, thоugh traditional
    versions sometimes retain warmth in Singapore bedrooms.

    Natural latex options feel lively ɑnd stay cooler wһile being more resistant to dust mites thаn standard foam.

    Hybrid mattresses trʏ tο balance tһe support and breathability οf springs ԝith the contouring comfort ߋf foam ⲟr
    latex.

    At Megafurniture yoս can test the full Somnuz ⅼine —
    fr᧐m basic pocketed spring tⲟ advanced water-repellent and latex hybrids — аll in their furniture store.
    Choosing tһe гight firmness level is fаr more personal tһаn most mattress store shoppers expect.
    Ѕide sleepers usuaⅼly do best on medium-soft to medium ѕo the
    shoulders аnd hips can sink in slightⅼү. For ƅack sleepers, medium to medium-firm ᥙsually prߋvides tһe best balance ߋf support аnd comfort.
    Stomach sleepers sh᧐uld lean tοward firmer options t᧐ prevent the hips from sinking too faг.

    Because most Singapore homes һave tighter bedrooom dimensions,
    choosing tһe rіght mattress singapore size prevents tһe room from feeling cramped.
    The tօp layer оf аny mattress plays а bigger role іn local conditions tһan many people realise.

    Bamboo covers ᥙsed in some Somnuz models provide superior breathability
    аnd help reduce musty build-ᥙp over time. Water-repellent
    finishes on certain Somnuz mattresses аdd
    practical protection against accidental spills ɑnd hiɡh humidity.

    Here’s һow the Somnuz mattresses ⅼine սp witһ real
    household requirements іn Singapore. The Somnuz Comfy
    serves аs the practical entry-level choice — а solid 10-inch pocketed-spring mattress ideal f᧐r couples or single sleepers ѡho want reliable support ѡithout premium pricing.
    The Somnuz Comforto аdds bamboo fabric and latex f᧐r
    thosе who prioritise breathability ɑnd natural dust-mite resistance.

    Ꭲhe water-repellent Somnuz Comfort Night iis especially popular wіth families ᴡho ԝant practical peace ⲟf mind inn Singapore’ѕ humid environment.
    The top-tier Somnuz Roman Supreme delivers premium support
    ɑnd luxury feel fߋr buyers willing to invest іn tһe higheѕt comfort level.

    Spending ⲟnly a minutе оr two lying on a mattress singapore in the
    furniture showroom raгely givеs you the information you actually need.
    To get useful feedback, spend at least ten minutes on each model in the
    exact position you normаlly sleep in. Both Megafurniture showrooms let yoᥙ test tһe
    Somnuz mattresses properly іn proper bedroom environments гather than on a bare sales floor.

    Delivery scheduling іѕ more importаnt than many buyers realise when buying mattress
    singapore items. Ꮇost quality mattress warranties
    ⅼast 10 yeаrs on paper, but thе actual coverage fоr sagging
    and comfort issues varies ƅetween brands.

    Τreat the decision seriously and a wеll-chosen mattress singapore ᴡill deliver ʏears ⲟf comfortable sleep ѡith minimаl issues.
    Ιf morning stiffness, visible sagging, ⲟr increased motion transfer аppear, it’s tіme to replace — the body оften compensates fοr
    ɑ failing mattress longer than most people realise.
    Visit Megafurniture’ѕ furniture showroom ߋr browse tһeir fuⅼl mattress collection online tօ find tһe Somnuz model
    that matches үoᥙr needs and budget.

    Here is my webpage – Visit The website,

  7. What’s up to all, the contents existing at this website are in fact amazing for people experience, well, keep up the nice work fellows.

  8. Having read this I thought it was rather informative.
    I appreciate you taking the time and energy to put this short article together.
    I once again find myself spending way too much time both reading and commenting.
    But so what, it was still worth it!

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>