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.

12,560 thoughts on “Play Framework HTML5 input elements

  1. For hottest information you have to pay a visit internet and on the web I found this website as a most excellent web page for most recent updates.

  2. Woah! I’m really enjoying the template/theme of this blog.
    It’s simple, yet effective. A lot of times it’s challenging to get that “perfect balance” between superb usability and appearance.
    I must say you’ve done a excellent job with this. Additionally, the
    blog loads extremely fast for me on Chrome.
    Outstanding Blog!

  3. OMT’s documented sessions all᧐ԝ studenfs ttake ɑnother ⅼoοk at motivating explanations anytime, growing their love fօr
    mathematics and fueling tһeir ambition for examination victories.

    Join ᧐ur small-groᥙp on-site classes in Singapore for personalized guidance іn a
    nurturing environment tһat develops strong fundamental mathematics
    skills.

    Іn a system wherе math education has progresseed tо promote innovation and international
    competitiveness, registering іn math tuition maқes sᥙre
    trainees stay ahead by deepening tһeir understanding and application of
    key concepts.

    primary school school math tuition іs crucial fߋr PSLE preparation аs it assists
    trainees master the foundational principles lіke portions аnd decimals, whicһ are grfeatly checked in thе examination.

    Linking math ideas tօ real-wⲟrld scenarios thrօugh tuition deepens
    understanding, mаking O Level application-based questions mսch more
    approachable.

    Tuition incorporates pure аnd ᥙsed mathematics seamlessly, preparing trainees fоr thе interdisciplinary nature оf A Level
    troubles.

    Ꮃhat sets OMT aрart iѕ its custom curriculum tһat aligns wіtһ MOE whiⅼe using adaptable pacing, allowing sophisticated students tο increase their discovering.

    OMT’s ѕystem іs straightforward оne, sо eѵеn novices ϲan browse and begin boosting
    grades rapidly.

    Ꮤith worldwide competitors climbing, math tuition settings Singapore pupils ɑѕ
    leading entertainers in worldwide mathematics evaluations.

    Ꭺlso visit my һomepage … secondary math tuition centre singapore

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

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

  5. My family all the time say that I am wasting my time here at net, but I
    know I am getting experience daily by reading thes
    good content.

  6. Hi, i read your blog occasionally and i own a similar one and i was just curious if you get a lot of spam
    remarks? If so how do you prevent it, any plugin or anything you
    can suggest? I get so much lately it’s driving me crazy so any assistance
    is very much appreciated.

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

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

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

  9. A free eSIM gives users a simple way to test digital mobile
    connectivity without visiting a shop, waiting for a plastic card, or swapping a physical esim tray.

  10. Thank you, I’ve just been searching for information approximately this subject for ages
    and yours is the greatest I have discovered till now. But, what about the conclusion? Are you positive concerning the supply?

  11. Do you have a spam problem on this website; I also am a blogger, and
    I was curious about your situation; many of us have created some nice procedures and we are looking to swap methods with others, why not shoot me an e-mail if interested.

  12. Wanted to drop a long note about how Jane ended up using Paybis to shift her money from her bank into crypto and then straight into her trading
    account, and honestly, her whole story turned out way more entertaining than anyone thought.

    Jane isn’t your regular crypto newbie. Random detail: she collects tiny vintage
    globes and has exactly 27 of them lined up behind her
    desk. Another random thing is that she can solve a Rubik’s
    cube in under 40 seconds. So when she discovered Paybis, she approached it with the same
    energy — fast, efficient, and determined.

    According to her, she wanted a platform that wouldn’t “fight her back,
    ” because her bank is already stressful enough. Paybis ended up being perfect:
    smooth verification, easy deposit, and she was able to convert her bank funds into
    crypto in literally minutes. She laughed saying it was easier than ordering
    sushi.

    Once the crypto hit her wallet, she jumped straight into her trading platform — everything happening instantly.
    And because she’s Jane, she turned it into a personal speed-challenge.
    She kept notes on each step, and of course, she made a whole spreadsheet about it.
    Little detail: she names her spreadsheets after planets.

    What surprised her most was how Paybis didn’t overwhelm her with complicated menus.
    She likes things simple — after all, she once
    returned a coffee machine because it had “too many buttons.” So
    the clean process from bank → crypto → trading felt
    like a win.

    She hinted that anyone wanting to try the same flow should check the
    link inside this comment, but she didn’t want
    to make a big deal of it. Just said it might be helpful.

    Overall, Jane’s whole experience using Paybis was refreshingly
    easy, surprisingly fun, and very “Jane-style” — structured, quirky, and full of little experiments.

    For anyone interested, she said the link in the comment explains everything
    a bit deeper, but that’s totally optional.

  13. Very shortly this web page will be famous amid all blogging and site-building users, due to it’s pleasant articles

  14. This is a useful website.
    Many users are searching for online services like this.

    Always choose a safe source for better experience.

  15. It’s a pity you don’t have a donate button! I’d certainly donate to
    this fantastic blog! I suppose for now i’ll settle for bookmarking and adding your RSS feed to my
    Google account. I look forward to brand new updates and will share this site with my Facebook group.

    Talk soon!

  16. I’m impressed, I must say. Seldom do I come across a blog that’s
    equally educative and amusing, and without a doubt, you have hit the nail on the head.
    The problem is something that not enough men and women are speaking intelligently about.
    I am very happy I came across this in my search for something regarding this.

  17. Hi tһere mates, fastidious post ɑnd nice arguments commented һere, І аm truly enjoying by these.

    My site Home Cleaning [Diana]

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>