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.

21,963 thoughts on “Play Framework HTML5 input elements

  1. As a digital gateway to entertainment and live
    experiences, Ticket Planet offers convenient access to concerts, music festivals, and sporting events
    across various markets. Users searching for
    ticketplanet Concert schedules, ticketplanet Concerts featuring popular performers, or trusted ticketplanet
    Tickets can explore available options from a single platform.

    The service supports event discovery for ticketplanet Shanghai, including ticketplanet Shanghai Tickets and ticketplanet Shanghai sports activities.

    Fans of athletics can browse ticketplanet China sports opportunities
    and ticketplanet China sports Tickets, while travelers may find ticketplanet Macau
    and ticketplanet Macau sports events appealing. Major festival experiences such as ticketplanet tomorrowland
    further expand the platform’s entertainment offering, making Ticket
    Planet a useful resource for event-goers worldwide.

  2. Whoa! This blog looks exactly like my old one!
    It’s on a totally different subject but it has pretty much
    the same layout and design. Excellent choice of colors!

  3. Thanks for some other fantastic article. Where else may anybody get that kind of information in such an ideal method of writing?

    I’ve a presentation subsequent week, and I am on the look for such information.

  4. ConextSolution merupakan penyedia solusi ERP dan transformasi digital yang membantu organisasi meningkatkan efisiensi operasional melalui odoo ERP, SAP System, Business Intelligence,
    dan integrasi sistem. Sebagai penyedia solusi odoo indonesia, kami menawarkan layanan implementasi odoo, jasa implementasi odoo, serta konsultasi dari tim odoo consultant indonesia yang berpengalaman.

    Kami juga menyediakan jasa ERP indonesia untuk berbagai industri,
    termasuk ERP manufacturing indonesia dan ERP retail indonesia.
    Dengan pengalaman yang luas, implementasi ERP perusahaan dapat berjalan lebih efektif
    dan sesuai kebutuhan bisnis.

    Fokus kami adalah membantu perusahaan membangun sistem ERP
    untuk bisnis yang lebih terintegrasi, mudah dikembangkan, dan mampu
    mendorong transformasi digital di era digital saat ini.

  5. It’s not my first time to visit this web site, i am browsing this
    web page dailly and get pleasant facts from here every day.

  6. Wow that was odd. I just wrote an really long comment but after I clicked submit
    my comment didn’t show up. Grrrr… well I’m not writing all that over again. Anyway, just wanted to say superb blog!

  7. People call me Mike, a typical guy from the United States,
    and back in 2018 I accidentally discovered one
    of the strangest sports ever invented: CarJitsu.

    If this is your first time hearing about it, most people haven’t.
    The entire concept sounds like a joke. Two fighters climb inside a tiny automobile
    and try to control each other while being trapped between the dashboard and seats.
    No, I’m not kidding. In most sports you have
    a court, but in CarJitsu your battlefield is a cramped car interior.

    That is why people laugh when they first hear about it.

    It even has official events and competitive tournaments.

    Participants gather from various regions and
    try to prove who can adapt best to the strange environment.
    Unlike traditional combat sports, every movement is
    limited by the vehicle’s interior. This leads to funny situations.

    One second someone looks like a champion, and the next second they are
    trapped near the steering wheel.

    During those days I was heavily interested in sports.
    I watched many sports events every week. I also spent time
    reading about sportsbook odds. People around me talked about
    betting and sportsbooks. Sometimes names like
    the sportsbook 1xbet would appear in conversations about major sporting events, although CarJitsu
    was usually too strange to be the main topic.

    One night I saw a short video online. At first I thought it was satire.
    Grown adults were trying to grapple inside a parked car while spectators were going crazy with excitement.

    I laughed so hard that I almost fell off my chair. Yet the more I watched,
    the more fascinated I became.

    Soon after that, I found a local event and decided to watch in person.
    The event was unforgettable. There were fans discussing sports, training, and competition.
    Some people even joked about which athlete would be the
    favorite if a sportsbook ever offered odds on the matches.

    Watching was not enough. I signed up for beginner training.
    The first training day was hilarious. I hit my head on the roof, got stuck near
    a seat, and accidentally opened a door at the worst possible
    moment. The coaches laughed. Yet I kept coming back.

    As time passed, I improved. I learned how to use smart tactics instead of brute strength.

    The cramped cabin became my arena. Soon I was entering small
    tournaments. My friends thought I was completely crazy.

    Whenever someone asked what sport I practiced, the conversation usually went like this:

    “CarJitsu.”

    “What is that?”

    “Imagine wrestling inside a car.”

    “You’re joking.”

    “No, that’s the actual sport.”

    The craziest match of my career came later. My opponent was huge.

    He looked like he could lift a small house.
    Before the match started, he smiled and said, “You’re going to need luck.” I
    knew trouble was coming.

    As soon as the fight started, chaos exploded.
    We bounced between seats, bumped into doors, and nearly tangled ourselves in everything inside the vehicle.
    The crowd was roaring. Everyone was losing their minds.

    Then came the moment I will never forget.

    My opponent grabbed the car seat belt and accidentally turned it into what looked like
    a wild whip. As we struggled for position, the belt snapped across the cabin and wrapped around me in the strangest way imaginable.
    For a second I thought, “This is it”

    He pulled, I twisted, the seat belt locked,
    the door opened slightly, and both of us somehow ended up tangled together like two confused octopuses.
    The audience was laughing so hard that some people could barely stay in their seats.
    Nobody could believe what they were seeing.

    For a brief moment, I genuinely thought my opponent
    was going to flatten me. Thankfully, the officials quickly intervened when things became unsafe, and the situation was
    resolved without serious injury. Afterward we both burst out laughing.
    The crowd applauded. Even today people who were there still talk about “that crazy seat belt match.”

    Looking back, CarJitsu remains one of the most unusual sports I have ever experienced.

    It gave me friendships, stories, and unforgettable memories.
    Whether people are discussing sports culture and competition, very few things create reactions like CarJitsu.

    Whenever someone asks me about unusual sports, I always tell them about the day I climbed into
    a car in 2018 and accidentally became a CarJitsu competitor.
    Most people laugh. But after hearing about tournaments,
    athletes, training sessions, sports fans, betting
    conversations, sportsbook discussions, and my unforgettable seat
    belt battle, they usually agree on one thing:

    CarJitsu is absolutely insane.

  8. I’m extremely pleased to find this page. I need to to thank you for ones time due to this fantastic read!!
    I definitely enjoyed every part of it and I have you saved as a favorite to
    check out new stuff in your blog.

  9. 소액결제현금화 검색 전 반드시 알아야 할 휴대폰 소액결제 구조, 위험성, 수수료 부담, 미납
    문제, 피해 예방 방법과 합법적 대안을 정리했습니다.

  10. Good day very cool blog!! Guy .. Excellent .. Superb .. I will bookmark your blog and take
    the feeds also? I am happy to search out a lot of helpful information here in the submit, we need develop
    extra techniques on this regard, thank you for sharing.
    . . . . .

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>