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.

20,328 thoughts on “Play Framework HTML5 input elements

  1. Hmm is anyone else experiencing problems with the images on this
    blog loading? I’m trying to determine if its a problem on my end or if it’s the blog.

    Any feedback would be greatly appreciated.

  2. This is a very informative post about online casinos and betting platforms.
    I especially liked how it explains the importance of choosing a
    licensed site before signing up.

    Many players often ask where they can find reliable gaming platforms with fair odds and smooth payouts.

    From what I’ve seen, checking platforms like vn22vip helps users compare features, bonuses, and overall experience.

    Thanks for sharing these insights — they’re helpful for both beginners and experienced bettors.

  3. My brother suggested I might like this web site.
    He was totally right. This put up actually made my day.
    You cann’t imagine simply how a lot time I had spent for this info!

    Thanks!

  4. Hello, Neat post. There is a problem with your website in web explorer, might
    test this? IE still is the market leader and a large portion of people
    will omit your fantastic writing due to this problem.

  5. It’s a shame you don’t have a donate button! I’d most 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 share this website with my Facebook group.
    Talk soon!

  6. First off I would like to say superb blog! I
    had a quick question which I’d like to ask if you don’t
    mind. I was interested to find out how you center yourself and clear your mind prior to writing.

    I’ve had a tough time clearing my thoughts in getting my ideas out.
    I do enjoy writing however it just seems like the first 10 to 15 minutes are generally lost
    just trying to figure out how to begin. Any suggestions or hints?
    Many thanks!

  7. I was pretty pleased to discover this web site. I want to to thank you for ones
    time for this particularly wonderful read!! I definitely liked
    every part of it and i also have you saved as a favorite to check out new stuff
    in your site. ### 文章 3:文書處理與 PDF 編輯的完美融合:WPS Office 的殺手級應用

    長期以來,文書處理與 PDF 編輯是兩項獨立的工作,往往需要透過不同的軟體來完成,過程繁瑣且效率低下。WPS Office
    繁體中文免費版則打破了這種隔閡,將這兩者完美融合,讓您的文件處理工作一氣呵成,堪稱「殺手級」的應用。

    在文書處理方面,WPS 文字功能強大,完全可媲美市面上任何主流文書軟體。它不僅能流暢地開啟和編輯各種格式的文檔,更貼心地內建了豐富的**線上範本庫**。無論是需要書寫一份標準公函、一份複雜的學術論文,還是製作精美的簡歷,只需在範本庫中搜尋,一鍵套用,即可擁有專業的排版與設計,極大地節省了從零開始構思的時間。

    而其**內建的 PDF 編輯功能**,則是 WPS Office 的一大亮點。您不再需要額外安裝笨重的 PDF 軟體,只需在 WPS
    中開啟 PDF 檔案,便能像編輯 Word 文檔一樣,輕鬆地**修改文字、插入圖片、添加注釋,甚至是合併與分割 PDF 頁面**。同時,任何一個文檔都可以一鍵轉換成 PDF 格式,確保文件內容不會輕易被修改,方便分享與存檔。

    WPS Office 將兩大核心功能集於一身,不僅節省了寶貴的硬碟空間,更**簡化了工作流程**。無論您是在處理一份報告,還是需要快速修改一份合約,WPS Office 都能讓您在一個平台、一套熟悉的操作邏輯下,輕鬆駕馭。正是這種追求極致效率的設計理念,讓它在眾多辦公軟體中脫穎而出。告別軟體切換的煩惱,從 WPS Office 開始。
    Telegram 安卓 下载

    ### 文章 7:省錢、相容、超輕量:WPS Office 與 Microsoft Office 詳細對比

    在選擇辦公軟體時,WPS Office 與 Microsoft Office 的比較,始終是繞不開的話題。許多人誤以為免費的 WPS
    功能必定「低人一等」,但事實上,WPS Office 以獨特的優勢,在「省錢」、「相容」與「輕量」三個關鍵維度上表現出色,成為了極具競爭力的首選。

    首先,最大的差異來自於 **「授權費用」** 。Microsoft
    Office 通常需要支付數百元的年費或一次性購買費用,而 WPS 提供的個人免費版,則無需花費一分錢,就能使用其大多數核心功能。對於學生、家庭用戶與預算有限的中小企業來說,這無疑是極具吸引力的解決方案。

    其次,在 **「格式相容性」** 上,WPS Office 的表現可以說是「青出於藍而勝於藍」。它不僅能完美開啟和編輯所有標準的 Word、Excel、PowerPoint 文件,還能確保這些文件無論在什麼設備上開啟,排版都不會錯亂。這得益於 WPS 為了深度相容微軟格式所付出的巨大努力。

    最後,在 **「體積與性能」** 方面,WPS Office
    擁有絕對優勢。其安裝包大小僅約 270 MB,而 Microsoft Office 則動輒超過 1 GB。這意味著 WPS
    能在老舊硬體或低配電腦上流暢運行,啟動迅速,這對於硬體更新週期較長的使用者而言是「救星」。「省錢、相容、超輕量」的優勢,使 WPS 成為在考量綜合成本與實用性下的明智之選。
    telegram下载

  8. I was just searching for this info for some time. After 6 hours of continuous Googleing, finally I got it in your site. I wonder what is the lack of Google strategy that don’t rank this kind of informative websites in top of the list. Generally the top websites are full of garbage.

  9. Good day! This post could not be written any better!
    Reading this post reminds me of my old room mate! He always kept chatting about this.
    I will forward this article to him. Fairly certain he
    will have a good read. Thank you for sharing!

  10. I do trust all the concepts you have introduced on your post.
    They’re really convincing and will certainly
    work. Nonetheless, the posts are very short for starters.
    May you please extend them a little from subsequent time? Thank you for the post.

  11. I every time emailed this blog post page to all my contacts, since if like to read it then my
    friends will too.

  12. It’s actually very complicated in this full of activity life to listen news on TV, thus I simply use
    world wide web for that purpose, and obtain the most up-to-date
    information.

  13. De acordo com Marra, outra pesquisa realizada no Brasil,
    entre 2002 e 2003, envolvendo 2.862 homens com mais de
    quarenta anos, revelou que 45% deles experimentaram algum
    grau de disfunção erétil durante este período. https://vibs.me/g1-vialis-plus-funciona-anvisa-composicao-preco-valor-comprar-resenha-farmacia-bula-reclame-aqui-saiba-tudo-2024/

  14. Hey just wanted to give you a brief heads up and let you know a few of the pictures aren’t loading properly.

    I’m not sure why but I think its a linking issue.
    I’ve tried it in two different web browsers and both show the same
    outcome.

  15. Greetings! This is my first visit to your blog!
    We are a collection of volunteers and starting a new initiative
    in a community in the same niche. Your blog provided us valuable information to work on. You have done a extraordinary job!

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>