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

  1. Its like you read my mind! You appear to know a lot about this, like you wrote
    the book in it or something. I think that you could do with some
    pics to drive the message home a little bit, but instead of
    that, this is great blog. A fantastic read. I will certainly be back.

  2. Hey there, You have done a great job. I’ll certainly digg it and personally
    recommend to my friends. I am sure they’ll be benefited from this website.

  3. How to use SMM panel safely is the most important lesson for long-term
    growth. At GetFollowerFast.com we teach every customer these
    six proven rules so they never face bans or drops.
    Rule 1: Start small – test with 100–500 units first.
    Rule 2: Always enable drip feed to spread delivery over days.
    Rule 3: Choose only high retention non-drop services with refill guarantee.
    Rule 4: Mix SMM services with regular organic posting and engagement.
    Rule 5: Never share your account password – our panel only needs public username.
    Rule 6: Monitor your account and enable 2FA.

    When you follow these steps, using an common mistakes smm panels panel is 100% safe.
    GetFollowerFast.com makes it easy with clear service descriptions
    and 24/7 support. Our VIP auto refill and country targeted options add extra safety and quality.

    Many users who switched from cheap panels now
    enjoy stable growth with us. Safety is built into every order.

    Ready to grow safely? Join GetFollowerFast.com today and follow
    our guide. Your account will thank you.

  4. You are so awesome! I don’t believe I’ve truly read through something like
    that before. So wonderful to find somebody with some genuine thoughts on this subject matter.
    Seriously.. many thanks for starting this up. This web site is one thing that is needed on the internet,
    someone with some originality!

    Feel free to visit my site … dragon stuffed animal jellycat

  5. Do you mind if I quote a couple of your articles as long as I provide credit and sources
    back to your blog? My website is in the exact same area of interest as yours and my visitors would certainly benefit from some of the information you present here.

    Please let me know if this ok with you. Thanks!

    Also visit my page – stuffed animal dragon

  6. I have been exploring for a little for any high-quality articles or blog posts on this
    sort of house . Exploring in Yahoo I ultimately stumbled upon this
    web site. Studying this information So i’m glad to convey that I’ve an incredibly excellent uncanny feeling I found out exactly what I
    needed. I most indisputably will make sure to don?t overlook this
    website and provides it a look regularly.

  7. I’m gone too cpnvey my little brother, tthat he shoulld also visut this webpage onn regulqr basios to gett updatedd fro hottest news.

    Here iss myy page – pornadoo.com

  8. Hello there I am so happy I found your site, I really
    found you by accident, while I was browsing on Yahoo for something else,
    Anyhow I am here now and would just like to say many
    thanks for a remarkable post and a all round enjoyable blog (I also love the theme/design),
    I don’t have time to browse it all at the minute but I have saved it
    and also added in your RSS feeds, so when I have time I will be back to read a lot more, Please do keep up the great jo.

  9. Have you ever considered creating an e-book or guest authoring on other sites?
    I have a blog centered on the same information you discuss and would really like to have you share some stories/information. I know my visitors would enjoy your work.
    If you’re even remotely interested, feel free to shoot me an e mail.

    Also visit my web page – dragon plush toy

  10. Hey there! I know this is kind of off topic but
    I was wondering which blog platform are you using for this site?
    I’m getting sick and tired of WordPress because I’ve had problems with hackers and I’m looking
    at options for another platform. I would be great
    if you could point me in the direction of a good
    platform.

  11. You really make it seem so easy with your presentation but I find this matter to be actually something which I think I would never understand.
    It seems too complicated and very broad for me.
    I am looking forward for your next post, I’ll try to get the hang
    of it!

  12. Postingan yang sangat informatif! Informasi ini
    sangat relevan bagi siapa pun yang ingin memahami perkembangan industri manufaktur di tanah air.
    Penting bagi kita untuk terus mendukung dan mengenal lebih dekat perusahaan legendaris seperti **PT.
    ARUN NGL** yang telah menjadi bagian dari sejarah besar kemajuan energi tanah air.
    Lanjutkan ulasan berkualitasnya! Kunjungi PT. ARUN NGL

  13. Howdy! Do you know if they make any plugins to assist with Search Engine Optimization?
    I’m trying to get my blog to rank for some targeted keywords
    but I’m not seeing very good results. If you know of any please share.
    Many thanks!

    Also visit my blog … jelly cats dragon

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>