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.

12,417 thoughts on “Play Framework HTML5 input elements

  1. Hi, i think that i saw you visited my web site thus 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!!

  2. Heya i’m for the primary time here. I found this board and I in finding It really useful
    & it helped me out much. I’m hoping to offer one thing again and help others like you aided me.

  3. I do consider all the ideas you’ve presented to your post.
    They are very convincing and will definitely work. Still, the posts are very brief for newbies.
    May just you please extend them a little from subsequent time?
    Thank you for the post.

  4. Hello my family member! I want to say that this post is amazing, nice written and include approximately all
    important infos. I’d like to look extra posts like this .

  5. Link exchange is nothing else except it is simply placing the other person’s website link on your page at suitable place and other
    person will also do same in favor of you.

  6. Its such as you read my mind! You seem to know a lot about this,
    such as you wrote the ebook in it or something. I believe that you can do with a few
    percent to force the message house a little bit, but instead of that, this is great blog.
    A great read. I will definitely be back.

  7. When I originally commented I clicked the “Notify me when new comments are added” checkbox and now each
    time a comment is added I get three e-mails with the same comment.
    Is there any way you can remove me from that service?
    Thank you!

  8. I don’t even know how I stopped up here, however I thought this post was
    great. I do not recognise who you’re however certainly
    you’re going to a famous blogger in the event you are not already.
    Cheers!

  9. Simply desire to say your article is as astounding.

    The clarity in your post is just cool and i can assume you’re an expert on this subject.

    Well with your permission let me to grab your RSS feed to keep up to date
    with forthcoming post. Thanks a million and please continue
    the gratifying work.

  10. Do you have a spam problem on this site; I also am a blogger, and I was
    curious about your situation; we have developed some nice practices and we are looking to swap techniques with others, why not shoot
    me an e-mail if interested.

  11. Appreciating the time and effort you put into your blog and
    in depth information you provide. It’s nice to come across a
    blog every once in a while that isn’t the same unwanted rehashed material.

    Great read! I’ve saved your site and I’m adding your RSS feeds to my
    Google account.

  12. Wonderful beat ! I wish to apprentice while you amend your site,
    how could i subscribe for a blog site? The account helped me a acceptable deal.
    I were tiny bit acquainted of this your broadcast provided vivid transparent
    concept

  13. Hello, all is going fine here and ofcourse every one is sharing information,
    that’s actually excellent, keep up writing.

  14. Thanks , I’ve recently been searching for information about this topic
    for ages and yours is the best I’ve came upon so far.
    But, what about the bottom line? Are you positive concerning the supply?

  15. Thanks , I’ve recently been searching for information approximately this topic for a while and yours is the best I
    have came upon till now. However, what in regards to the conclusion? Are you sure in regards to the supply?

  16. Greetings! Very helpful advice in this particular article!
    It is the little changes which will make the biggest changes.
    Thanks for sharing!

  17. When I initially commented I clicked the “Notify me when new comments are added” checkbox and now
    each time a comment is added I get several emails with
    the same comment. Is there any way you can remove people from that service?
    Appreciate it!

  18. Ista stvar i kod mene. Njihov sustav je spas za fiskalizaciju u hodu.
    Sve je čisto i jasno, a cijena je i više nego fer.
    Palac gore za njih.

  19. Hmm it seems like your site ate my first comment (it was extremely long) so I guess
    I’ll just sum it up what I submitted and say,
    I’m thoroughly enjoying your blog. I too am an aspiring blog
    writer but I’m still new to everything. Do you have any helpful hints for first-time blog writers?
    I’d certainly appreciate it.

  20. My brother suggested I might like this web site. He was totally right.
    This post actually made my day. You cann’t imagine just how much time I had spent for this info!
    Thanks!

  21. What’s up, after reading this amazing piece of
    writing i am also cheerful to share my knowledge
    here with mates.

  22. Today, while I was at work, my sister stole my apple
    ipad and tested to see if it can survive a 25 foot drop, just so she can be a youtube sensation. My iPad
    is now broken and she has 83 views. I know this is entirely off topic but I
    had to share it with someone!

  23. Hey there I am so thrilled I found your webpage, I really found you by mistake, while I was searching on Aol for something else, Anyhow I
    am here now and would just like to say thanks for a fantastic post and a all round exciting blog (I also
    love the theme/design), I don’t have time to look over it
    all at the minute but I have book-marked 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 fantastic b.

  24. I was recommended this website by my cousin. I’m not sure whether this post is written by him as no one
    else know such detailed about my trouble. You are incredible!

    Thanks!

  25. That is really attention-grabbing, You are an overly skilled blogger.
    I have joined your rss feed and look forward to searching
    for more of your magnificent post. Also, I have shared your web site in my social networks

  26. I delight in, lead to I discovered just what I used to be looking for.

    You have ended my four day long hunt! God Bless you man. Have
    a nice day. Bye

  27. Pretty nice post. I simply stumbled upon your weblog and
    wished to say that I’ve really loved browsing your blog posts.
    In any case I will be subscribing in your feed and I hope you write again soon!

  28. Heya! I’m at work browsing your blog from my new iphone 4!

    Just wanted to say I love reading your blog and look forward to all your posts!

    Carry on the outstanding work!

  29. Consіdering the approaching PSLE, starting math tuition early equips Primary
    1 to Primary 6 studets ᴡith ѕelf-assurance and proven methods tⲟ excel in major
    school examinations.

    Regular secondary math tuition equips students t᧐ successfuⅼly tackle
    common obstacles — including speed аnd accuracy սnder timed conditions,
    graph analysis, ɑnd multi-step logical reasoning.

    Ιn Singapore’s education system wһere Mathematics аt
    H2 level іs mandatory oг stronglу recommended foг ɑ
    wide range of prestigious faculties, math tuition functions аs a strategic long-term investment that safeguards
    ɑnd maximises future tertiary аnd career prospects.

    Ϝor JC students targeting highly sought-аfter degree programmes in Singapore,
    online math tuition ⲣrovides specialised techniques fߋr application-heavy problemѕ, often creating the winning
    margin between a ρаs and a һigh distinction.

    Ᏼy emphasizing conceptual mastery, OMT exposes mathematics’ѕ internal beauty, sparking
    love and drive for leading examination grades.

    Discover tһe benefit of 24/7 online math tuition ɑt OMT,
    where engaging resources mɑke learning fun and reliable fⲟr all levels.

    Witһ mathematics incorporated perfectly іnto Singapore’s classroom settings t᧐ benefit bοth instructors аnd
    students, devoted math tuition magnifies tһese gains by սsing customized
    assistance fоr continual accomplishment.

    Math tuition іn primary school bridges gaps іn classroom learning, ensuring trainees grasp complex subjects ѕuch as geometry and infοrmation analysis befoгe thе PSLE.

    Comprehensive coverage οf the ԝhole Ο Level syllabus іn tuition guarantees no topics, from sets tⲟ vectors, are
    neglected іn a trainee’s alteration.

    By providing comprehensive experiment ρast A Level test documents, math tuition familiarizes students ᴡith question formats and marking schemes for optimal performance.

    OMT’ѕ custom-made math curriculum distinctively sustains MOE’ѕ by providing prolonged coverage օn topics ⅼike algebra,
    ԝith exclusive faster ѡays for secondary pupils.

    Unrestricted retries оn quizzes sia, Ƅest for understanding topics аnd achieving tһose Α grades in math.

    Math tuition inclᥙdes real-ԝorld applications,
    mаking abstract curriculum subjects pertinent аnd lesѕ complicated to use in Singapore examinations.

    Also visit mу web-site – secondary 1 exam papers (singaporeboleh.neocities.org)

  30. I really like your blog.. very nice colors & theme. Did you create this
    website yourself or did you hire someone to do it for you?
    Plz answer back as I’m looking to construct my own blog and would like to
    find out where u got this from. many thanks

  31. It’s going to be ending of mine day, but before end I am
    reading this impressive piece of writing to increase my experience.

  32. Hey there! Do you use Twitter? I’d like to follow you if that
    would be ok. I’m definitely enjoying your blog and look forward to new updates.

  33. Here’s a quick share of how Jane ended up using Paybis to
    move her money from her bank into crypto and then straight
    into her trading account, and honestly, her whole story turned out way more unexpected
    than anyone thought.

    Jane isn’t your regular crypto newbie. Fun fact:
    she collects tiny vintage globes and has exactly 27 of
    them lined up behind her desk. Another random thing is that she can solve a Rubik’s
    cube in under 40 seconds. So when she discovered Paybis,
    she approached it with the same energy — fast, efficient, and determined.

    According to her, she wanted a platform that wouldn’t “fight her back,” because her bank is
    already stressful enough. Paybis ended up being
    perfect: quick setup, easy deposit, and she was able to convert her
    bank funds into crypto in literally minutes. She made a joke that
    it was easier than ordering sushi.

    Once the crypto hit her wallet, she jumped straight into her trading platform — everything happening instantly.
    And because she’s Jane, she turned it into a personal speed-challenge.
    She measured how long every step took, and of course,
    she made a whole spreadsheet about it. Fun fact:
    Jane has 38 spreadsheets for her hobbies.

    What surprised her most was how Paybis didn’t overwhelm her with complicated menus.

    She likes things simple — after all, she once returned a coffee machine because it had “too many
    buttons.” So the clean process from bank →
    crypto → trading felt like a win.

    She hinted that anyone wanting to try the same flow should
    check the link inside this comment, but she didn’t
    want to make a big deal of it. Just said it might be helpful.

    In the end, Jane’s whole experience using Paybis was refreshingly
    easy, surprisingly fun, and very “Jane-style” — structured, quirky,
    and full of little experiments.

    If you’re curious, she said the link in the comment explains everything a bit deeper,
    but that’s totally optional.

  34. Hello there! I know this is kinda off topic but I was wondering which blog platform are you using for this website?

    I’m getting fed up of WordPress because I’ve had issues with hackers and I’m looking
    at options for another platform. I would be awesome if
    you could point me in the direction of a good platform.

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>