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.

8 thoughts on “Play Framework HTML5 input elements

  1. Stay ahead in the world of horse racing with Gallop News. Our platform provides the latest news on horse racing events across the UK. Enjoy in-depth race reviews from our experienced team. Whether you are a casual fan or a seasoned bettor Gallop News offers industry trends to enhance your horse racing experience. Subscribe and never miss an update from Gallop News

  2. His father strokes his own cock in the shower the dew from his cock mixes with the drops condensing on the glass. url=https://arturzasada.pl/gay sex porn/url His father’s words are what he hears when he erupts. His cum streaming like liquid threads from the pee-hole of his rigid cock.

  3. “This is what a man looks like son.” His father says as his pants fall to the floor. From his waist out pops his representation of a 40-year-old-man. And father of two teenage boys. His cock. “I’m am nearly 6 foot 2 inches tall dad. I weigh 210 lbs. I think dad. At least I was the last time we were weighed at football practice.” The son says. “Much bigger than you I should say.”

  4. “Last I measured I was nearly eight inches dad. Maybe more. I may be even bigger who knows.” He answers nonchalantly. The now lukewarm water streams through the curls of his hair rinsing away the last vestiges of the soapy lather. It all goes down the drain in a swirl of bubbles.

  5. “Yes, sir.” He says as he straightens up, standing erect as his member pulses to life between his legs, and in his father’s right hand, which are firmly locked on his balls. “Yes, sir, I do.”

  6. “Let me get in there, Garrett.” His father says, as his son steps aside so he can get into the shower enclosure.

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>