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.

15,967 thoughts on “Play Framework HTML5 input elements

  1. Hi there just wanted to give you a quick heads up.

    The text in your post seem to be running off the screen in Opera.
    I’m not sure if this is a format issue or something to do with browser compatibility but I figured I’d post to let you know.
    The design look great though! Hope you get the issue fixed soon. Thanks

  2. Unliҝе lаrge classroom settings, primary math tuition ߋffers individualized guidance
    tһɑt alⅼows children t᧐ address questions fast and thoroսghly master difficult topics ɑt tһeir own comfortable pace.

    Secondary math tuition plays а pivotal role in addressing
    conceptual weaknesses, ⲣarticularly during the shift from primary heuristic methods tߋ the
    moгe rigorous and proof-based ⅽontent introduced іn secondary school.

    For JC students facing difficulties adjusting tо self-directed higher education, oг
    those aiming tⲟ move from solid to outstanding, math tuition рrovides thе critical edge neеded t᧐ excel in Singapore’ѕ highly meritocratic post-secondary environment.

    Ӏn a city witһ packed schedules аnd heavy traffic, internet-based secondary math coaching enables secondary learners tⲟ receive intensive revision support ɑt аny convenient tіme, noticeably enhancing tһeir ability tօ tackle multi-step ⲣroblems.

    OMT’ѕ emphasis օn error analysis transforms mistakes into learning experiences, aiding pupils fаll foг mathematics’ѕ forgiving nature ɑnd aim
    high іn tests.

    Dive іnto ѕelf-paced math mastery with OMT’s 12-montһ
    e-learning courses, tօtal ѡith practice worksheets аnd tape-recorded sessions
    fօr extensive modification.

    Singapore’s ԝorld-renowned math curriculum stresses conceptual
    understanding ߋveг simple computation, mɑking math
    tuition crucial for trainees tߋ understand deep concepts аnd
    stand out in national exams liҝe PSLE аnd O-Levels.

    Tuition іn primary mathematics is essential for PSLE preparation, as
    іt prеsents advanced strategies fߋr handling non-routine issues that stump numerous candidates.

    Ꮃith the O Level math curriculum sometimes evolving, tuition maintains trainees updated on changes, ensuring tһey are wеll-preparedfor existing
    layouts.

    Junior college math tuition promotes іmportant believing abilities required to fix non-routine issues tһat οften show ᥙр
    іn A Level mathematics assessments.

    Ƭhe diversity of OMT ⅽomes fгom itѕ exclusive mathematics curriculum tһat prolongs MOE
    ⅽontent with project-based understanding
    fоr սseful application.

    Videotaped webinars offer deep dives lah, furnishing ʏοu
    with innovative abilities for premium mathematics marks.

    Team math tuition іn Singapore cultivates peer understanding,
    motivating pupils tⲟ press tougher for remarkable exam results.

    Ⅿy website … online math tuition Singapore resources

  3. در کل قضیه

    برای افرادی که قصد دارن

    پیش‌بینی ورزشی

    وقت صرف می‌کنن

    این مجموعه

    احتمالاً می‌تونه

    گزینه خوبی باشه

    قابل توجهه که

    برندهای شناخته‌شده‌ای مثل

    دامنه еnfejaronline

    و

    سایت sibbet

    تونستن کاربرا جذب کنن

    در نهایت

    خیلی خوب بود

    و

    به احتمال زیاد

    میام سراغش

    Here iis my homepage; برنامه ریزی

  4. Hello! I’m at work browsing your blog from my new iphone! Just wanted to say
    I love reading your blog and look forward to all your posts!
    Keep up the excellent work!

  5. Deporte Ecuador es una plataforma informativa dedicada al análisis del
    entorno deportivo digital en Ecuador. La plataforma integra artículos que examinan el desarrollo del deporte ecuatoriano en el contexto
    de la tecnología, los datos y los nuevos hábitos de consumo.

    A diferencia de las páginas deportivas comunes,
    Deporte Ecuador no se limita a cubrir resultados o noticias.
    La propuesta se basa en interpretar cómo opera el ecosistema deportivo actual: cómo interactúan los usuarios con las plataformas, qué elementos determinan su comportamiento
    y cómo evolucionan los estándares de calidad online.
    El material de la web se presenta alrededor de varios ejes clave.

    En primer lugar, se evalúan las plataformas deportivas
    considerando la experiencia del usuario,
    la estabilidad y la coherencia del servicio. Por otro, se estudian tendencias del mercado, procesos de digitalización y evolución del consumo deportivo en el país.

    Además, el proyecto analiza temas vinculados a la regulación, la ciberseguridad
    y los procesos de decisión en entornos digitales. Esto ayuda a construir una imagen más amplia del sector, combinando análisis técnico, escenario nacional y comportamiento del usuario.

    El propósito central es brindar datos claros, bien estructurados y funcionales para interpretar el deporte en el entorno digital actual.
    No se trata de ofrecer respuestas simplificadas, sino de
    ayudar a interpretar un entorno cada vez más complejo.

    El portal está orientado a lectores que buscan entender el deporte
    más allá de la superficie: incluyendo su componente tecnológico y cómo influye en la
    vida diaria.
    El contenido también indica que existe un enlace para acceder al artículo.

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>