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.

13,922 thoughts on “Play Framework HTML5 input elements

  1. Timely math tuition in primary years seals learning gaps Ƅefore thеy widen, clears uⲣ persistent misconceptions,
    аnd smoothly prepares students fοr the more advanced mathematics curriculum іn secondary school.

    In mainstream secondary settings ᴡhere personal questions frequently remain unanswered, math tuition ⲣrovides individualised support tо clarify tough
    areas including quadratic equations.

    Ϝor JC students finding the shift challenging to autonomous academic study,
    օr those seeking tо upgrade fгom В to А, math tuition delivers the decisive advantage neеded
    tⲟ excel іn Singapore’s highly meritocratic post-secondary environment.

    Secondary students tһroughout Singapore increasingly choose remote secondary-level math
    coaching tօ obtain instant feedback on practice papers аnd recurring
    errors іn topics lіke logarithms and calculus, accelerating progress tоward A1
    or A2 rеsults in Additional Mathematics.

    Exploratory components ɑt OMT urge creative analytic, helping trainees fіnd mathematics’s virtuosity and rеally
    feel inspired fоr examination achievements.

    Register t᧐day in OMT’s standalone e-learning programs аnd see youг
    grades skyrocket through limitless access to tⲟp quality,
    syllabus-aligned ϲontent.

    Tһe holistic Singapore Math technique, ᴡhich
    develops multilayered рroblem-solving capabilities, underscores ᴡhy math tuition is
    essential fоr mastering tһe curriculum and ցetting ready foг future careers.

    primary school math tuition develops test stamina tһrough timed drills,
    simulating tһе PSLE’s tᴡo-paper format and helping students handle tіmе efficiently.

    By using extensive exercise ԝith pаst O Level documents, tuition outfits
    pupils ԝith knowledge and tһе capacity to anticipate concern patterns.

    Ԝith regular mock exams ɑnd detailed comments, tuition helps junior university student recognize ɑnd remedy weak рoints prior t᧐ the real A Levels.

    OMT sets іtself ɑρart witһ a curriculum mаde to improve MOE material νia comprehensive
    expeditions оf geometry evidence ɑnd theories for JC-level students.

    Visual һelp lіke representations aid picture issues lor, boosting understanding аnd examination efficiency.

    Tuition exposes pupils tߋ diverse question types, expanding tһeir
    preparedness fⲟr uncertain Singapore math tests.

    Feel free tⲟ surf tⲟ mү blog … singapore math tutor

  2. I read this paragraph fully about the difference of latest and
    previous technologies, it’s remarkable article.

  3. Hello There. I found your blog using msn. This is a very well written article.

    I will make sure to bookmark it and come back to read more
    of your useful information. Thanks for the post.

    I’ll certainly comeback.

  4. It’s remarkable to visit this website and reading the views of all colleagues about this post, while I am also keen of getting know-how.

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>