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.

9,506 thoughts on “Play Framework HTML5 input elements

  1. I do not even know how I ended up here, but I thought this
    post was great. I do not know who you are but definitely
    you’re going to a famous blogger if you are not already ;) Cheers!

  2. Excellent blog here! Also your site loads up very fast!
    What web host are you using? Can I get your affiliate link to your host?

    I wish my web site loaded up as quickly as yours lol

  3. Статьи, личный опыт, руководства по преодолению тревоги, развитию критического
    мышления, гигиене информации и самопомощи.

    Корпоративные программы: Психологическая поддержка сотрудников компаний для улучшения их благополучия.

    Философия: Создание поддерживающего и человечного пространства, где забота о ментальном здоровье становится нормой
    Преодолении тревоги информационная гигиена

  4. Thanks for the auspicious writeup. It if truth be told was once a entertainment account it.
    Glance advanced to more brought agreeable from you! By the way, how can we be in contact?

  5. Hi there, its nice post concerning media print, we all
    be aware of media is a impressive source of facts.

  6. This paragraph is actually a good one it helps new internet
    users, who are wishing in favor of blogging.

  7. Почему пользователи выбирают площадку
    KRAKEN?
    Маркетплейс KRAKEN заслужил доверие многочисленной аудитории благодаря сочетанию
    ключевых факторов. Во-первых, это широкий и разнообразный ассортимент, представленный сотнями продавцов.
    Во-вторых, интуитивно понятный
    интерфейс KRAKEN, который упрощает навигацию, поиск товаров и управление заказами даже для новых пользователей.
    В-третьих, продуманная система безопасных транзакций, включающая механизмы разрешения споров (диспутов)
    и возможность использования условного депонирования,
    что минимизирует риски для обеих сторон сделки.
    На KRAKEN функциональность сочетается с внимательным отношением к безопасности клиентов, что делает процесс покупок
    более предсказуемым, защищенным и,
    как следствие, популярным среди пользователей, ценящих анонимность и надежность.

  8. Hi it’s me, I am also visiting this site on a
    regular basis, this website is genuinely pleasant and the viewers are
    really sharing nice thoughts.

  9. My spouse and I stumbled over here by a different page and thought I should check things out.

    I like what I see so now i am following you.
    Look forward to exploring your web page repeatedly.

  10. Timely math tuition іn primary ʏears seals learning gaps Ƅefore
    thеy widen, clears սp persistent misconceptions, аnd smoothly
    prepares students f᧐r thе more advanced mathematics curriculum іn secondary school.

    Мore than merely enhancing grades, secondary math tuition cultivates emotional
    resilience аnd greɑtly reduces exam-related stress duгing one of tһе most pressurised stages οf a teenager’s
    academic journey.

    Considerіng the intense pace and extensive syllabus coverage ᧐f thе JC programme, regular math
    tuition helps students гemain on schedule, review productively, ɑnd
    avoid panic cramming.

    Online math tuition stands οut for primary students in Singapore ᴡhose
    parents ᴡant consistent syllabus reinforcement ѡithout fixed centre timings, ɡreatly easing anxiety whіle building strong foundational numeracy.

    By highlighting conceptual proficiency, OMT reveals mathematics’ѕ
    innеr appeal, stiring up love and drive for tοp examination qualities.

    Transform math challenges іnto victories with OMT Math
    Tuition’s blend oof online аnd on-site alternatives, Ьacked
    Ƅy а performance history of student excellence.

    Ιn a ѕystem where mathematics education һas evolved to cultivate innovation ɑnd worldwide
    competitiveness, registering іn math tuition mаkes sure trainees remain ahead by deepening theіr understanding аnd application of key
    principles.

    Ԝith PSLE mathematics contributing considerably
    tο totɑl scores, tuition supplies additional resources ⅼike design responses
    fоr pattern acknowledgment andd algebraic thinking.

    Tuition promotes innovative analytical abilities, essential fоr solving the complicated,
    multi-step inquiries tһat specіfy O Level math challenges.

    With Α Levels influencing occupation courses in STEM аreas, math tuition reinforces fundamental
    skills fοr future university studies.

    Ꮤhat maкes OMT remarkable is its exclusive curriculum tһat
    aligns with MOEwhile ρresenting aesthetic aids ⅼike bar modeling in innovative mеans
    for primary learners.

    Recorded sessions іn OMT’s ѕystem аllow үou rewind ɑnd replay lah, guaranteeing ʏⲟu recognize evеry principle for first-class examination гesults.

    Math tuition builds ɑ strong portfolio of skills,
    improving Singapore trainees’ resumes fօr scholarships based οn examination results.

    Αlso visit mу pаge – Online Math Tuition Singapore For Monthly

  11. Heya i’m for the first time here. I came across this board
    and I find It truly useful & it helped me out a lot. I hope to give something
    back and aid others like you aided me.

  12. %spintax|こちらの記事|この内容|この投稿%は%spintax|非常に|とても|実に% %spintax|参考になる|役立つ|興味深い%です!%spintax|セクシーランジェリー|コスプレ衣装%の%spintax|選び方|コーデ術|着心地の見極め方%について%spintax|詳しく|分かりやすく|具体的に%解説されていて、%spintax|初心者|コスプレ好き|ランジェリー愛好家%には%spintax|必見|大変役立つ%内容です。補足ですが、%spintax|ASRRSS|アスレス%は%spintax|コスプレランジェリーに特化|デザインが豊富|品質が信頼できる%サイトで、%spintax|ぜひチェックしてみて|おすすめします%!

  13. Hey there! I know this is kinda off topic but I was wondering which blog platform are you using for this website?
    I’m getting sick and tired of WordPress because I’ve had issues with hackers and I’m looking at options for another platform.

    I would be fantastic if you could point me in the direction of a good platform.

  14. Hello! This post could not be written any better!
    Reading through this post reminds me of my old room mate! He always
    kept talking about this. I will forward this article to him.
    Pretty sure he will have a good read. Thank you for sharing!

  15. My brother recommended I would possibly like this website.
    He used to be entirely right. This put up truly made my day.
    You cann’t believe just how much time I had spent for this information! Thanks!

  16. We absolutely love your blog and find a lot of your post’s to be just what I’m
    looking for. Do you offer guest writers to write content available for you?
    I wouldn’t mind creating a post or elaborating on most of
    the subjects you write about here. Again, awesome site!

  17. Temukan kekayaan bersih Russell Johnson, sorotan kariernya, pencapaian hidup, dan fakta-fakta yang kurang dikenal.
    Jelajahi perjalanan keuangannya.

  18. Terrific work! That is the kind of info that are meant to be shared around the web.
    Shame on Google for now not positioning this put up higher!

    Come on over and discuss with my site . Thank you =)

  19. Thanks for a marvelous posting! I definitely enjoyed reading
    it, you happen to be a great author. I will make sure to bookmark your
    blog and will eventually come back from now on. I want to encourage you to ultimately continue your great job,
    have a nice afternoon!

  20. Consistent primary math tuition helps young learners tackle common challenges
    including heuristic techniques ɑnd rapid calculation skills, ԝhich are
    heavily tested in school examinations.

    Secondary math tuition stops tһe accumulation of conceptual errors tһat сould severely hinder progress іn JC H2 Mathematics,
    making proactive support іn Sec 3 and Ꮪec 4 ɑ vеry wise
    decision fⲟr forward-thinking families.

    Ԝith tһe һigh volume and dense content load ߋf tһe JC programme, regular math tuition helps students гemain ᧐n schedule, review productively,
    ɑnd ɑvoid panic cramming.

    Secondary students ɑcross Singapore increasingly depend ߋn online math tuition tօ receive live targeted instruction оn demanding topics including coordinate geometry аnd calculus, ᥙsing
    interactive screen-sharing tools гegardless of location.

    Individualized assistance fгom OMT’s seasoned tutors helps pupils conquer math hurdles, fostering а sincere link
    tо tһe subject and motivation for exams.

    Enroll tⲟday іn OMT’ѕ standalone е-learning programs ɑnd watch уour grades skyrocket through unrestricted access t᧐ һigh-quality, syllabus-aligned material.

    Сonsidered thɑt mathematics plays ɑ pivotal function іn Singapore’s financial developmentt and
    progress, investing іn specialized math tuition gears ᥙp
    trainees wіth the analytical skills required tߋ flourish in a competitive landscape.

    primarytuition іs essential for constructing durability versus PSLE’ѕ difficult questions, ѕuch as those on likelihood
    and easy data.

    Іn-depth comments fгom tuition trainers ߋn practice attempts assists secondary trainees gain fгom mistakes,
    boosting accuracy fоr thе real O Levels.

    Tuition teaches mistake evaluation strategies, assisting junior college
    pupils prevent typical mistakes іn А Level
    calculations ɑnd proofs.

    By incorporating exclusive strategies with the MOE syllabus, OMT uѕеs
    a distinct approach tһаt stresses clearness and depth іn mathematical reasoning.

    Versatile organizing means no encountering CCAs οne, making
    sure well balanced life ɑnd rising math scores.

    Singapore’ѕ emphasis ᧐n analytical in mathematics tests mаkes tuition essential fⲟr developing imp᧐rtant thinking abilities
    рast school һߋurs.

    Als᧐ visit my blog post … normal technical math paper

  21. I’m extremely impressed together with your writing skills and also with the structure on your weblog.
    Is that this a paid subject matter or did you customize it your self?
    Either way keep up the nice quality writing, it is rare to peer a nice
    weblog like this one nowadays..

  22. Excellent post. Keep posting such kind of info on your site.
    Im really impressed by your site.
    Hello there, You’ve performed an incredible job. I’ll definitely digg it and in my opinion suggest to
    my friends. I’m sure they will be benefited from this web site.

  23. Всем привет оставляю коммент, просто хочу
    поделиться личным опытом. Я из Беларуси,
    давно увлекаюсь онлайн-геймингом, и всё началось с того, что я решил поэкспериментировать с читами в пара своих любимых
    игр.
    Не буду скрывать, иногда садился играть под энергетик,
    чаще всего пил Red Bull — и оно как-то добавляло драйва.

    Я очень люблю анимешные игры, в особенности залипал в Genshin Impact.

    Но дальше началось самое интересное:
    мой аккаунт в Steam забанили. Античит словил модификации и
    решил, что я нарушитель. Да, я понимал риск, но всё равно досадно, ведь на аккаунте куча игр была.

    И да, в тексте есть ссылка, можете посмотреть — вдруг пригодится.

    Хотя, если честно, это было забавно.
    Процесс игры приносил
    кучу эмоций, пусть даже
    последствия и закономерные.
    Так что теперь просто делюсь опытом, может кому-то
    пригодится, что даже если весело, бан никто не
    отменял.

  24. Way cool! Some very valid points! I appreciate you writing this article plus the rest of the website is very good.

  25. I love what you guys are up too. This sort of clever
    work and reporting! Keep up the great works guys I’ve
    included you guys to my blogroll.

  26. Почему пользователи выбирают площадку KRAKEN?

    Маркетплейс KRAKEN заслужил доверие многочисленной аудитории благодаря сочетанию ключевых
    факторов. Во-первых, это широкий
    и разнообразный ассортимент,
    представленный сотнями продавцов.
    Во-вторых, интуитивно понятный интерфейс KRAKEN, который упрощает навигацию, поиск товаров
    и управление заказами даже для новых
    пользователей. В-третьих, продуманная система безопасных транзакций, включающая механизмы разрешения споров (диспутов) и
    возможность использования условного депонирования, что минимизирует риски для обеих сторон сделки.
    На KRAKEN функциональность сочетается с внимательным отношением к безопасности клиентов, что делает процесс покупок более предсказуемым, защищенным и, как следствие, популярным среди пользователей,
    ценящих анонимность и надежность.

  27. Всем привет закидываю коммент, может
    кому пригодится. Сам я белорус, давно играю в онлайн-игры, и
    вся эта история началась с того, что мне стало скучно и я решил попробовать читы в играх, в которые рублюсь уже много лет.

    Не буду скрывать, иногда садился играть под энергетик,
    чаще всего выбирал Monster — и оно как-то добавляло драйва.
    Я всегда любил аниме-игры, в особенности
    залипал в Naruto Shippuden games.
    Но тут случилось неприятное:
    мой стімовский аккаунт отправили в перманентный бан.

    Античит обнаружил читы и мгновенно дал пермач.

    Да, я сам виноват, но всё равно неприятно, ведь столько всего было куплено.

    И да, добавил ссылку, можете посмотреть — вдруг пригодится.

    Хотя, если честно, это было забавно.

    Было реально весело в моменте, хоть и понимал, что за это наказывают.

    Так что теперь просто делюсь опытом, вдруг кому поможет, что
    любые читы рано или поздно всплывают —
    и бан прилетит.

  28. Hi there! I know this is kinda off topic but I was wondering if you knew where I could locate a captcha plugin for my comment
    form? I’m using the same blog platform as yours and I’m having difficulty finding one?
    Thanks a lot!

  29. For most recent news you have to visit web and on world-wide-web I found this
    website as a finest site for most recent updates.

  30. Wonderful, what a web site it is! This weblog provides helpful information to us, keep it up.

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>