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.

21,925 thoughts on “Play Framework HTML5 input elements

  1. My partner and I stumbled over here by a different website and thought I may as
    well check things out. I like what I see so now i am following
    you. Look forward to looking over your web page yet again.

  2. My coder is trying to persuade me to move to .net from PHP.
    I have always disliked the idea because of the expenses.
    But he’s tryiong none the less. I’ve been using WordPress on a
    variety of websites for about a year and am anxious about switching to another platform.
    I have heard great things about blogengine.net.
    Is there a way I can import all my wordpress content into
    it? Any kind of help would be really appreciated!

    Also visit my site: 강남가라오케

  3. Admiring the hard work you put into your website and detailed information you provide.
    It’s good to come across a blog every once in a
    while that isn’t the same outdated rehashed information. Excellent read!
    I’ve saved your site and I’m including your RSS feeds to my Google account.

  4. This is really interesting, You’re an excessively professional blogger.
    I have joined your rss feed and stay up for seeking extra of your magnificent post.
    Also, I have shared your website in my social networks

    Here is my site; Siete login

  5. Article writing is also a fun, if you be
    familiar with then you can write or else it is complex to write.

  6. I am really enjoying the theme/design of your weblog. Do you ever run into any internet browser compatibility issues?
    A number of my blog audience have complained about my site not
    working correctly in Explorer but looks great in Firefox.
    Do you have any tips to help fix this problem?

  7. Excellent beat ! I wish to apprentice at the same time
    as you amend your web site, how can i subscribe for
    a weblog website? The account aided me a acceptable deal.
    I have been tiny bit acquainted of this your broadcast offered
    shiny clear concept

    Here is my homepage – 강남가라오케

  8. Good day! This is my first visit to your blog! We are a group of volunteers and
    starting a new initiative in a community in the
    same niche. Your blog provided us useful information to work on. You have done a marvellous job!

    Here is my web-site; Contemporary R&B

  9. Spot on with this write-up, I actually feel this site needs a lot more attention. I’ll probably be back again to see more,
    thanks for the information!

  10. We stumbled over here coming from a different web address and thought
    I may as well check things out. I like what I see so now i’m following you.
    Look forward to finding out about your web page repeatedly.

  11. I’m not sure why but this site is loading incredibly slow for me.
    Is anyone else having this problem or is it a problem on my end?
    I’ll check back later and see if the problem still exists.

  12. در جمع‌بندی نهایی

    برای کسایی که قصد شروع دارن

    فضای شرط‌بندی آنلاین

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

    این سایت

    به سادگی می‌تونه

    قابل توجه باشه

    جالبه که

    برندهایی مثل

    еnfejaronline برتر

    و

    sibbet اصلی

    تونستن کاربرا جذب کنن

    در کل

    کاربردی بود

    و

    قطعا

    میام بررسیش کنم

    Here is my website: مهندسی کامپیوتر
    (Alyssa)

  13. Thank you a lot for sharing this with all of
    us you actually understand what you are speaking approximately!
    Bookmarked. Please also talk over with my web site =).

    We may have a link exchange arrangement between us

  14. OMT’s interactive tests gamify learning, mɑking math addictive fօr
    Singapore pupils ɑnd inspiring them t᧐ press for impressive test grades.

    Enroll tоday in OMT’ѕ standalone e-learning programs аnd enjoy your grades
    soar tһrough unrestricted access to premium, syllabus-aligned ϲontent.

    Τhe holistic Singapore Math technique, ѡhich builds multilayered analytical abilities, highlights ᴡhy math tuition is
    essential for mastering thе curriculum ɑnd
    gettіng ready fоr future careers.

    Ƭhrough math tuition,
    students practice PSLE-style concerns սsually аnd charts, enhancing precision аnd speed
    ᥙnder exam conditions.

    Ꮤith O Levels highlighting geometry proofs аnd theses, math tuition supplies specialized drills tօ make sure pupils can tackle tһese with precision ɑnd confidence.

    Math tuition аt the junior college degree emphasizes conceptual quality оver memorizing memorization, impoгtant
    for dealing with application-based A Level questions.

    OMT’ѕ one-of-a-kіnd educational program, crafted to sustain the MOE curriculum, consists оf individualized
    modules tһɑt adapt to private understanding styles fоr even more efficient math proficiency.

    OMT’ѕ online platform enhances MOE syllabus օne, aiding yߋu take on PSLE mathematics easily andd mᥙch better ratings.

    Math tuition demystifies innovative topics ⅼike calculus fοr A-Level trainees, leading tһе way foг university admissions in Singapore.

  15. An outstanding share! I have just forwarded this onto a coworker
    who had been conducting a little research on this.
    And he in fact bought me dinner due to the fact that I found it for him…
    lol. So allow me to reword this…. Thank YOU
    for the meal!! But yeah, thanx for spending time to talk about this matter here on your website.

  16. Attractive component to content. I simply stumbled upon your blog and in accession capital to claim that I acquire
    in fact enjoyed account your weblog posts.
    Any way I’ll be subscribing to your feeds or even I fulfillment you get right of entry to constantly rapidly.

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>