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.

6,710 thoughts on “Play Framework HTML5 input elements

  1. Collaborative οn-line difficulties at OMT build synergy іn mathematics,
    cultivating love аnd cumulative inspiration fօr tests.

    Dive int᧐ self-paced mathematics mastery ѡith OMT’ѕ 12-mߋnth e-learning courses, ϲomplete
    with practice worksheets аnd recorded sessions fⲟr comprehensive revision.

    Аs mathematics forms the bedrock of sensіble thinking ɑnd
    imрortant pгoblem-solving in Singapore’ѕ education ѕystem, expert math tuition оffers the personalized
    guidance neⅽessary to᧐ turn obstacles into triumphs.

    Eventually, primary school school math tuition іs essential for
    PSLE quality, as іt gears uр students with the tools t᧐ achieve leading bands and secure favored secondary school
    placements.

    Math tuition ѕhows effective time management methods, helping secondary students fսll O Level examinations within the allotted period
    ѡithout hurrying.

    By providing considerable experiment ⲣast A Level exam documents, math
    tuition familiarizes trainees ᴡith inquiry layouts and
    noting schemes for optimum efficiency.

    OMT’ѕ proprietary curriculum boosts MOE standards ƅу offering scaffolded understanding
    courses tһat gradually raise іn intricacy, building trainee confidence.

    Τhorough options ρrovided on-ⅼine leh, training you exɑctly һow to
    fix issues correctly fօr far better qualities.

    Witһ mathematics scores influencing hіgh school positionings,
    tuition іs keyy for Singapore primary pupils ɡoing for elite institutions Ƅy means of PSLE.

    Mʏ page :: beauty world centre secondary math tuition

  2. While you produce extra Seo-friendly content, you might have more opportunities to
    build thematic relevance within your site. The numerous varieties of hyperlink constructing strategies have been listed under.

    Replicate top-performing weblog content material: The company finds competitor weblog posts with high hyperlink volume
    and builds better resources around the same matter. When a number of
    pages cowl the identical key phrase, chances are high none cowl
    it comprehensively. Get featured on useful resource pages.
    Seeing which pages of competitors attract links is revealing,
    not simply in volume, however in context. Analyze competitor backlinks quantities to reviewing which websites
    hyperlink to opponents and figuring out opportunities to earn comparable or higher placements.

    This serves as a hyperlink building strategy by attracting backlinks naturally.

  3. Thanks for the auspicious writeup. It if truth be told
    was once a entertainment account it. Glance complex to more
    introduced agreeable from you! However, how can we keep up a correspondence?

  4. of course like your web-site but you need to take a look at the
    spelling on quite a few of your posts. Several of them are rife with spelling problems and I find it very bothersome to tell the truth on the other hand I will definitely come back again.

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>