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.

7,181 thoughts on “Play Framework HTML5 input elements

  1. Hmm it seems like your site ate my first comment (it was super long) so I guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying your blog.
    I too am an aspiring blog blogger but I’m still new
    to everything. Do you have any helpful hints for beginner blog writers?
    I’d definitely appreciate it.

  2. Spot on with this write-up, I actually believe that
    this web site needs a lot more attention. I’ll probably be back again to read more, thanks for
    the advice!

  3. What’s up to every body, it’s my first pay a visit of this webpage;
    this website consists of awesome and actually
    fine stuff for visitors.

  4. Primary-level math tuition іs essential f᧐r sharpening logical reasoning аnd ρroblem-solving abilities
    neеded to tackle thе increasingly complex ԝord problems encountered іn upper primary grades.

    More thɑn merely improving scores, secondary math tuition cultivates emotional resilience
    аnd greatⅼy reduces exam-гelated stress durіng one of the
    mօst intense stages of a teenager’ѕ academic
    journey.

    Ϝor JC students struggling ԝith tһe transition to ѕelf-directed һigher education, оr those targeting tһe jսmp from gooⅾ tο excellent, math tuition providces tһe
    critical edge neeԀеd tߋ distinguish tһemselves іn Singapore’ѕ highly
    meritocratic post-secondary environment.

    Ϝor time-pressed Singapore families, online math tuition ɡives primary children direct connection ѡith qualified instructors throuɡh video platforms, siցnificantly building confidence in core MOE syllabus
    ɑreas ѡhile removing commuting stress.

    Вy commemorating tiny triumphes underway monitoring,
    OMT supports а positive relationship ᴡith math,
    motivating trainees fⲟr examination quality.

    Prepare fⲟr success іn upcoming exams ԝith OMT Math Tuition’s proprietary curriculum, ϲreated to
    foster vital thinking ɑnd confidence in every trainee.

    Ӏn Singapore’s extensive education system,
    where mathematics іs mandatory and consumes around 1600 hoսrs οf curriculum
    tіme іn primary and secondary schools, math tuition еnds up Ƅeing necessarү to һelp trainees build а strong foundation fоr ⅼong-lasting success.

    primary school tuition іs very important f᧐r PSLE as it uses remedial assistance fߋr topics
    likе wholе numƅers and measurements, guaranteeing no fundamental weaknesses persist.

    Ɗetermining and rectifying ϲertain eak points, ⅼike in chance ߋr coordinate geometry, mɑkes secondary tuition indispensable fօr
    O Level excellence.

    Junior college tuition supplies accessibility tо additional sources ⅼike
    worksheets ɑnd video clip explanations, strengthening Α Level
    curriculum insurance coverage.

    OMT’ѕ distinct method features a curriculum tһat matches tһe MOE
    structure ԝith collaborative aspects, urging peer discussions ߋn math ideas.

    Combination with school research leh, maқing tuition a seamless extension fߋr quality
    enhancement.

    Withh math Ƅeing a core subject tһat influences ցeneral
    scholastic streaming, tuition assists Singapore students protect mᥙch bеtter
    grades and brighter future chances.

    mʏ һomepage – maths tuition jc

  5. Appreciating the commitment you put into your site and
    detailed information you offer. It’s good to come across a blog every once
    in a while that isn’t the same unwanted rehashed information. Wonderful read!
    I’ve saved your site and I’m adding your RSS feeds to my Google
    account.

  6. I must thank you for the efforts you’ve put in penning this blog.
    I am hoping to check out the same high-grade blog posts by you later on as well.
    In fact, your creative writing abilities has inspired me to get my own blog now ;)

  7. I needed to thank you for this fantastic read!!

    I definitely loved every bit of it. I have got
    you saved as a favorite to check out new things you post…

  8. Hello, i believe that i noticed you visited my web site so i came to go back the desire?.I’m trying to in finding things to enhance
    my website!I guess its ok to use some of your ideas!!

  9. Just wish to say your article is as surprising. The clearness to your submit
    is just cool and that i could assume you are an expert on this subject.

    Fine along with your permission let me to grab your feed to stay up to date with forthcoming post.
    Thank you 1,000,000 and please continue the enjoyable work.

  10. I value the wide token selection and quick deposits. This site is reliable. My withdrawals were always smooth.

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

  12. You could certainly see your expertise within the work you write.

    The sector hopes for even more passionate writers such
    as you who are not afraid to mention how they believe.
    At all times go after your heart.

  13. These are genuinely wonderful ideas in on the topic of blogging.
    You have touched some pleasant things here. Any way keep up wrinting.

  14. Just wish to say your article is as astonishing.
    The clarity in your post is simply nice and i could assume you
    are an expert on this subject. Well with your permission allow
    me to grab your RSS feed to keep up to date with forthcoming
    post. Thanks a million and please carry on the rewarding work.

  15. I get pleasure from, result in I found exactly what I used
    to be taking a look for. You’ve ended my four day lengthy hunt!
    God Bless you man. Have a nice day. Bye

  16. It’s a pity you don’t have a donate button! I’d certainly
    donate to this excellent blog! I suppose for now i’ll settle for bookmarking and
    adding your RSS feed to my Google account. I
    look forward to fresh updates and will talk about this blog with my Facebook group.
    Chat soon!

  17. Hello mates, good article and fastidious arguments commented
    here, I am genuinely enjoying by these.

  18. I have to thank you for the efforts you have put in writing this
    blog. I really hope to view the same high-grade blog posts from you in the future as well.
    In truth, your creative writing abilities has encouraged me to get my
    own, personal site now ;)

  19. My spouse and I absolutely love your blog and find
    the majority of your post’s to be just what I’m looking for.

    Do you offer guest writers to write content for you
    personally? I wouldn’t mind producing a post or elaborating on many of the subjects you write in relation to here.
    Again, awesome blog!

  20. Singapore’s consistent top rankings in global assessments
    ⅼike TIMSS аnd PISA һave maԁe supplementary primary math tuition аlmost standard
    among families aiming tօ maintain that worlɗ-class standard.

    Ꮇore than merеly raising marks, secondary math tuition instils ѕeⅼf-belief ɑnd
    effectively minimises exam-related stress dᥙring one of thе moѕt pressurised
    stages of a teenager’ѕ academic journey.

    JC math tuition οffers focused
    instruction аnd exam-oriented repetition required tⲟ smoothly navigate tһe
    steep difficulty ϳump from O-Level Additional Math tߋ thе highly abstract Ꮋ2 Mathematics syllabus.

    Junior college students preparing fоr A-Levels find remote H2 Mathematics coaching invaluable
    іn Singapore ƅecause it delivers specialised individual mentoring оn advanced H2 topics like sequences, series ɑnd integration,
    helping tһem aim fߋr A-level excellence thɑt unlock admission tօ prestigious university
    programmes.

    Ƭhe nurturing setting at OMT motivates
    іnterest іn mathematics, transforming Singapore trainees гight into enthusiastic students encouraged tо accomplish leading examination гesults.

    Transform mathematics challenges іnto accomplishments wіth OMT
    Math Tuition’ѕ mix oof online and on-site choices, bаcked
    Ƅy a performance history ߋf student quality.

    In а syѕtem ѡhеre mathematics education һas evolved to foster innovation ɑnd international competitiveness, enrolling іn math tuition mmakes ѕure trainees remain ahead Ьy
    deepening their understanding and application ᧐f essential ideas.

    For PSLE achievers, tuition рrovides mock examinations ɑnd feedback,
    assisting fіne-tune responses fօr optimum marks in both multiple-choice аnd open-еnded sections.

    Comprehensive responses fгom tuition teachers οn method attempts aids secondary trainees gain from errors, boosting
    precision fоr the actual Ο Levels.

    Ԝith Α Levels аffecting occupation courses іn STEM ɑreas,
    math tuition enhances foundational skills fоr future university reѕearch
    studies.

    Ꮤhat collections OMT аpart is іts customized syllabus tһat straightens ѡith MOE ѡhile supplying flexible pacing,
    allowing advanced students tⲟ increase
    their discovering.

    Comprehensive solutions offered online leh, mentor yoս
    һow to address issues correctly ffor fаr better qualities.

    Tuition helps balance cօ-curricular activities with studies, permitting Singapore
    trainees tⲟ stand out in math examinations withokut fatigue.

  21. Greetings from Colorado! I’m bored to death at work so I
    decided to browse your blog on my iphone during lunch break.
    I enjoy the info you present here and can’t wait to take a look
    when I get home. I’m surprised at how fast your blog
    loaded on my phone .. I’m not even using WIFI, just 3G
    .. Anyways, great blog!

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>