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

  1. I’m not sure where you are getting your information,
    but good topic. I needs to spend some time learning much more or understanding more.
    Thanks for magnificent info I was looking for this
    information for my mission.

  2. Hello, i think that i saw you visited my web site so i came to “return the favor”.I’m trying to
    find things to enhance my web site!I suppose its ok to use some of your
    ideas!!

  3. In fact no matter if someone doesn’t be aware of after that its up
    to other visitors that they will help, so here it occurs.

  4. I knopw thiss web siute gives qualify baed articles annd extra material, iss thwre anny ofher sitfe whoch ofters tese infokrmation inn quality?

    Stopp by mmy website; desixxx.biz

  5. Wow, wonderful blog layout! How long have you been blogging for?
    you made blogging look easy. The overall look of your web site is great,
    let alone the content!

  6. First of all I would like to say awesome blog!
    I had a quick question which I’d like to ask if you do not
    mind. I was interested to know how you center yourself and clear your thoughts before writing.

    I’ve had a hard time clearing my mind in getting my ideas out
    there. I do take pleasure in writing but it
    just seems like the first 10 to 15 minutes are usually wasted just trying to figure out how to
    begin. Any suggestions or hints? Cheers!

  7. Heya i am for the primary time here. I came across this board and I in finding It truly helpful & it helped me out much.

    I’m hoping to present something again and help
    others like you helped me.

  8. SUPER33 Indonesia Modern Platform merupakan platform digital modern yang menghadirkan pengalaman akses cepat, tampilan premium, dan layanan interaktif dalam satu tempat.
    Dengan desain yang responsif serta teknologi yang stabil, SUPER33 memberikan kenyamanan bagi pengguna
    dalam menikmati berbagai fitur modern secara praktis melalui perangkat mobile maupun desktop.

    Didukung dengan sistem yang aman, navigasi yang ringan, dan tampilan elegan, SUPER33 Indonesia Modern Platform dirancang
    untuk memberikan pengalaman digital yang lebih nyaman, efisien, dan mudah digunakan kapan saja.

    Platform ini juga menghadirkan suasana modern dengan dukungan layanan responsif
    sehingga pengguna dapat menikmati akses yang lebih
    optimal dan profesional.

  9. Best Mattress Singapore Guide – Ηow to Pick tһe Perfect Οne for Your
    Home

    Choosing ɑ new mattress singapore is one of tһe
    biggest Singapore furniture investments mоst households ᴡill make,
    yet іt’ѕ surprisingly easy to ɡet wrong.

    Moѕt people spend more time choosing a sofa thɑn they do
    choosing tһe mattress tһey use eveгy night. Megafurniture’ѕ Somnuz mattresses ցive you a practical ᴡay tߋ
    compare tһe most popular mattress types ѕide Ƅy side in one furniture showroom.

    Іn Singapore, ѕeveral local factors mɑke mattress singapore selection mߋre importаnt tһan in other countries.
    Because Singapore ѕtays humid ɑlmost аll year, excellent breathability
    is essential for keeping а mattress singapore fresh. Dust-mite sensitivity
    іs faг m᧐re ccommon һere than most people realise.
    Тhe widespread use of aircon at night can make ϲertain foam
    types feel firmer orr ⅼess comfortable tһan theу dіԁ
    under bright furniture store lights.

    Ꮃhen you walқ іnto any furniture showroom іn Singapore, yоu’ll mаinly see f᧐ur
    core mattress construction types worth comparing. Pocketed-spring mattresses սse individually wrapped coils that move independently, offering excellent motion isolation fօr couples ɑnd generally better
    airflow. Pure memory foam delivers excellent body contouring,
    үet mаny Singapore buyers now prefer versions ᴡith added
    cooling technology. Latex mattresses stand ᧐ut for their responsive bounce, superior
    breathability, аnd built-іn resistance tⲟ allergens ɑnd mould.
    Hybrid mattresses tгy to balance thе support and breathability of
    springs witһ tһe contouring comfort οf foam or latex.

    Megafurniture’ѕ Somnuz collection conveniently represents tһe main construction types m᧐st
    local families сonsider. Firmness levels ɑrе talked aboᥙt
    constantly, but what feels firm tօ οne person can feel medium ᧐r soft tο аnother.
    Side sleepers generɑlly benefit from medium-soft tⲟ medium
    firmness fοr proper spinal alignment. Вack sleepers
    often feel m᧐st comfortable ᧐n medium tο medium-firm surfaces that support tһe
    lower bɑck properly. Stomach sleepers ѕhould lean towаrⅾ firmer options tߋ prevent thе hips
    from sinking too fɑr.

    Bеcɑuse most Singapore homes have tighter bedroom dimensions, choosing tһe rigһt mattress singapore size prevents
    tһe rоom fгom feeling cramped. Τhe top layer ᧐f any
    mattress singapore plays а bigger role іn local conditions tһan mаny people realise.
    Bamboo covers սsed in some Somnuz models provide superior breathability ɑnd hеlp reduce
    musty build-սр over tіme. Water-repellent finishes οn certain Somnuz
    mattresses add practical protection аgainst accidental spills
    аnd high humidity.

    Here’ѕ h᧐ᴡ the Somnuz mattresses ⅼine ᥙр ᴡith real household
    requirements in Singapore. Somnuz Comfy is the go-tօ budget-friendly option foг many Singapore furniture shoppers looҝing for dependable pocketed spring
    support. Ιf you want better cooling and allergen resistance, the Somnuz Comforto ᴡith its bamboo-latex combination іs often thee smarter
    pick. Households tһat need spill ɑnd humidity protection ᥙsually lean tօward thе Somnuz Comfort Night model.

    Premium buyers ⲟften choose tһe Somnuz Roman Supreme fοr superior materials аnd
    long-term comfort.

    Most people test mattresses the wrong ᴡay ⅾuring furniture store visits — аnd it leads t᧐
    regret later. Ƭo get սseful feedback, spend ɑt least ten minuteѕ on each model іn the exact position yоu normalⅼy sleep in. B᧐th Megafurniture
    showrooms ⅼet yoᥙ test tһe Somnuz mattresses properly іn proper bedroom
    environments гather tһan on a bare sales floor.

    Ⅿake suгe the retailer can deliver on yoսr
    exact timeline, especially if yoᥙ’re furnishing a neᴡ HDB oг condo.

    Ꮇost quality mattress warranties ⅼast 10 үears οn paper,
    ƅut the actual coverage fߋr sagging аnd comfort issues varies bеtween brands.

    Ꭺ quality mattress sһould comfortably ⅼast 8–10
    years in Singapore conditions when chosen and maintained properly.
    Ιf morning stiffness, visible sagging, ⲟr
    increased motion transfer appear, it’s timke to replace — tһe body
    often compensates fоr a failing mattress longeг thаn moѕt people realise.

    Visit Megafurniture’ѕ furniture showroom or browse tһeir fսll mattrss collection online
    tօ find the Somnuz model thɑt matches үour needѕ and budget.

    my web site … online furniture

  10. You need to be a part of a contest for one of the most useful websites on the internet.
    I will recommend this blog!

  11. Fantastic beat ! I wish to apprentice while you amend your website, how could i subscribe for
    a blog website? The account helped me a acceptable deal.
    I had been a little bit acquainted of this your broadcast
    offered bright clear concept

  12. Dica: joguem Fortune Mouse depois do almoço. Acabei de pegar um Forra Máxima de lucro de 5 meses.

  13. Howdy! Someone in my Myspace group shared this website with us so I came
    to look it over. I’m definitely enjoying the information. I’m book-marking
    and will be tweeting this to my followers!
    Exceptional blog and excellent design.

  14. Hi there, of course this paragraph is really
    good and I have learned lot of things from it regarding blogging.
    thanks.

  15. Magnificent items from you, man. I have have in mind your stuff prior to and you’re just
    extremely great. I really like what you have bought right here, certainly like what you are stating and the best way wherein you are
    saying it. You are making it entertaining and you still take
    care of to keep it wise. I cant wait to learn much more from you.
    That is really a great site.

  16. What’s Taking place i am new to this, I stumbled upon this I’ve discovered It absolutely
    helpful and it has helped me out loads. I am hoping to give a contribution & aid different customers like its aided me.
    Good job.

  17. คอนเทนต์นี้ อ่านแล้วเข้าใจง่าย ครับ
    ดิฉัน ได้อ่านบทความที่เกี่ยวข้องกับ เรื่องที่เกี่ยวข้อง

    ดูต่อได้ที่ สมัคร betflix85
    น่าจะถูกใจใครหลายคน
    เพราะให้ข้อมูลเชิงลึก
    ขอบคุณที่แชร์ ข้อมูลที่มีประโยชน์ นี้
    จะรอติดตามเนื้อหาใหม่ๆ ต่อไป

  18. Hello, Neat post. There’s an issue along with your website in internet explorer, would test this?
    IE still is the marketplace chief and a huge part of other people will omit
    your great writing due to this problem.

  19. Thanks a lot for sharing this with all of us you
    actually realize what you’re talking approximately! Bookmarked.
    Kindly additionally visit my web site =). We could have a hyperlink trade contract
    among us

  20. You made some good points there. I looked on the net for additional information about the issue and found most individuals will go along with your views on this site.

  21. I’m extremely impressed with your writing skills as well as with the layout on your blog.

    Is this a paid theme or did you modify it yourself?

    Either way keep up the nice quality writing, it is
    rare to see a great blog like this one these days.

  22. I loved as much as you will receive carried out right here.
    The sketch is attractive, your authored subject
    matter stylish. nonetheless, you command get got an shakiness over that you wish be
    delivering the following. unwell unquestionably come more formerly again since exactly the same nearly very often inside case you shield this hike.

  23. It’s a pity you don’t have a donate button! I’d without a doubt donate to this excellent blog!
    I guess for now i’ll settle for book-marking and
    adding your RSS feed to my Google account. I look forward to new updates and
    will share this website with my Facebook group.

    Talk soon!

  24. Great goods from you, man. I have understand your stuff previous to and
    you are just too excellent. I really like what you have acquired here, certainly like
    what you are stating and the way in which you say it.
    You make it entertaining and you still take care
    of to keep it smart. I cant wait to read much more from you.

    This is really a terrific site.

  25. MUI demonstrated results in between SUI and UUI, depending
    on the nature of the underlying condition and
    the intervention utilized.

  26. I don’t know if it’s just me or if perhaps everybody else encountering issues with your blog.

    It looks like some of the written text within your posts are running off the screen. Can somebody
    else please comment and let me know if this is happening to them
    too? This might be a issue with my browser because I’ve had this happen before.
    Kudos

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>