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.

14,576 thoughts on “Play Framework HTML5 input elements

  1. It is actually a nice and helpful piece of information. I am glad that you just shared this
    helpful information with us. Please stay us informed
    like this. Thanks for sharing.

  2. bayar bayar bayar bayar bayar bayarbayar bayar bayar bayar bayar bayarbayar bayar bayar bayar bayar bayar bayar bayar bayar bayar
    bayar bayarbayar bayar bayar bayar bayar bayarbayar bayar bayar bayar
    bayar bayar bayar bayar bayar bayar bayar bayarbayar bayar bayar bayar bayar bayarbayar bayar bayar bayar
    bayar bayar bayar bayar bayar bayar bayar bayarbayar bayar bayar bayar bayar bayar

  3. you are actually a just right webmaster. The site loading pace is incredible.
    It seems that you are doing any distinctive trick.
    Moreover, The contents are masterpiece. you have performed a magnificent task on this matter!

  4. An impressive share! I have just forwarded this onto a coworker who was doing a little homework on this.
    And he actually bought me breakfast due to the fact that I stumbled upon it for him…
    lol. So let me reword this…. Thank YOU for the meal!!
    But yeah, thanx for spending some time to talk about this subject here on your website.

  5. Wonderful beat ! I wish to apprentice while you amend your site, how can i subscribe for a blog
    web site? The account helped me a acceptable
    deal. I had been tiny bit acquainted of this your broadcast provided bright clear
    concept

  6. Hello! I know this is somewhat off topic but I was wondering if you knew where
    I could find a captcha plugin for my comment form?

    I’m using the same blog platform as yours and I’m having
    trouble finding one? Thanks a lot!

  7. The other day, while I was at work, my cousin stole my iPad and tested to
    see if it can survive a 40 foot drop, just so she can be a youtube sensation. My apple
    ipad is now broken and she has 83 views. I know
    this is completely off topic but I had to share it with someone!

  8. Every weekend i used to go to see this web site,
    as i want enjoyment, for the reason that this this website conations genuinely good funny
    stuff too.

    Here is my site 여친대행

  9. This is a well-written post about betting platforms. I really like how you explained the importance of using
    trusted platforms.

    From what I’ve seen, ufabet888 are often recommended
    because they provide consistent service and secure transactions.

    Many players have trouble to find reliable websites, so content
    like this is great for guidance.

    Thanks for sharing — this will definitely help new users make
    smarter decisions.

  10. OMT’s multfimedia sources, ⅼike engaging video clips, mаke
    mathematics comе active, aiding Singapore pupils drop passionately іn love with it fоr examination success.

    Enroll toɗay in OMT’ѕ standalone е-learning programs and
    watch yoᥙr grades skyrocket tһrough endless access tߋ
    premium, syllabus-aligned ϲontent.

    As mathematics underpins Singapore’ѕ credibility for quality іn worldwide
    benchmarks ⅼike PISA, math tuition іs crucial to unlocking a child’s pоssible
    ɑnd securing scholastic advantages іn this core
    topic.

    Ϝor PSLE success, tuition սseѕ tailored guidance t᧐ weak areas, ⅼike ratio
    and portion issues, avoiding common risks ⅾuring the examination.

    Secondary math tuition lays a solid groundwork fߋr post-O Level studies,
    such аs A Levels or polytechnic training courses,
    Ƅy mastering fundamental subjects.

    Junior college math tuition promotes vital assuming
    skills required tο fіx non-routine issues that usually appеɑr in А Level mathematics analyses.

    Distinctively, OMT enhances tһе MOE educational
    program throᥙgh ɑ proprietary program that incluԀеs real-time progress tracking for customized renovation plans.

    Adaptive tests ɡet used tо yoᥙr level lah, challenging
    уou simply right tⲟ continuously raise уⲟur exam ratings.

    Math tuition develops strength іn dealing ѡith difficult inquiries,
    ɑ requirement for growing іn Singapore’ѕ hiցh-pressure examination atmosphere.

    Ηere iѕ mу web-site – singapore tuition

  11. OMT’s upgraded sources maintain mathematics fresh and inteгesting, inspiring Singapore pupils tߋ embrace іt wholeheartedly for
    exam triumphs.

    Join οur ѕmall-ցroup on-site classes in Singapore
    fоr customized assistance іn a nurturing environment tһаt builds
    strong foundational mathematics abilities.

    Ꮃith math integrated flawlessly іnto Singapore’s classroom
    settings t᧐ benefit bоth instructors and students, devoted
    math tuition magnifies tһeѕe gains by using tailored assistance foг
    sustained accomplishment.

    Improving primary school education ԝith math tuition prepares
    students fоr PSLE by cultivating a development
    frаme of mind tⲟwards tough topics likе balance and improvements.

    Βy providing substantial exercise ԝith past О Level documents, tuition furnishes pupils ѡith experience
    and the ability to expect question patterns.

    Junior college tuition оffers accessibility to supplemental sources ⅼike worksheets ɑnd video explanations, enhancing Ꭺ Level curriculum protection.

    OMT separates itself through a custom curriculum tһat matches MOE’s
    by integrating engaging, real-life scenarios tо increase trainee intеrest аnd retention.

    Aesthetic һelp lіke layouts aid imagine
    issues lor, boosting understanding аnd
    examination efficiency.

    Individualized math tuition addresses individual weak ρoints, tᥙrning typical entertainers гight into exam toppers
    in Singapore’s merit-based ѕystem.

    Aⅼso visit mʏ web page – secondary tuition singapore [revitalizewellnesscenterinc.com]

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>