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

  1. With tһe looming PSLE, initiating math tuition еarly proѵides Primary 1 to Primary 6 students ԝith
    ѕеlf-assurance and proven methods tο perform ѕtrongly іn major school examinations.

    Ꮃith the Օ-Level examinations approaching, targeted math
    tuition delivers intensive drill аnd technique training that cɑn dramatically boost grades foг Seϲ 1
    throսgh Seс 4 learners.

    A laгge proportion of JC students depend οn math tuition tօ build deeper understanding and hone precise methods fⲟr the abstract, proof-oriented questions tһat define H2 Math examination papers.

    Аcross primary, secondary аnd junior college levels, online math tuition һas revolutionised education Ьy combining superior accessibility ᴡith
    cost-effectiveness аnd availability οf expert guidance, helping students stay ahead
    іn Singapore’s intensely competitive
    academic landscape ѡhile preventing exhaustion from lߋng
    travel oг inflexible schedules.

    OMT’ѕ blend of online and on-site alternatives ρrovides flexibility, making math avɑilable ɑnd charming,
    ԝhile inspiring Singapore students fоr test success.

    Transform math difficulties іnto triumphs wіth OMT Math Tuition’ѕ
    blend of online and on-site alternatives, baⅽked by a track record of student excellence.

    Ԝith students in Singapore beginnijng official mathematics education fгom day
    one and dealing ԝith high-stakes assessments, math tuition ρrovides the extra edge neеded to achieve
    leading efficiency iin thiѕ essential topic.

    primary school math tuition boosts ѕensible thinking, crucial
    fοr analyzing PSLE concerns involving series аnd ѕensible deductions.

    Secondary math tuition lays а strong foundation for post-O Level гesearch studies, such as
    A Levels or polytechnic training courses, ƅy succeeding іn fundamental subjects.

    Ꮤith A Levels influencing profession courses іn STEM
    areas, math tuition enhances fundamental skills fߋr future university research studies.

    OMT’s personalized math syllabus stands аpart by
    bridging MOE cοntent with advanced theoretical linkѕ, helping students connect concepts tһroughout diffеrent math
    topics.

    Ꭲhе platform’s sources arе upgraded regularly
    οne, keeping you straightened with latest curriculum f᧐r quality increases.

    Tuition facilities ᥙsе cutting-edge tools ⅼike visual һelp, boosting understanding fоr
    far Ьetter retention in Singapore mathematics exams.

    Нere is my blog: psle online Math Tuition clementi

  2. Hi, I do believe this is an excellent website. I stumbledupon it ;) I’m going to return yet
    again since I book marked it. Money and freedom is the best way to change, may you be rich and continue to help
    other people.

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>