Skip to content

collective/collective.z3cform.html5widgets

Repository files navigation

Introduction

This addon provide many HTML5 form features to z3c.form.

BE WARNED: this addon is quite young, use it at your own risk.

Badges

Latest PyPI version

Number of PyPI downloads

image

Coverage

Widgets

  • color
  • contenteditable (+wysiwyg)
  • date
  • datetime
  • datetime-local
  • email
  • month
  • number
  • password
  • range
  • search
  • tel
  • time
  • url
  • week

New input attributes

This addon provide a base class HTML5InputWidget which support the following new attributes:

  • autocomplete
  • min
  • max
  • pattern
  • placeholder
  • required
  • step

So overriding the update method you can add values to theses values. By default the HTML5InputWidget base class do some test around support of theses attributes depending on the input's type.

required is automaticly bind on the field's required value.

step is automaticly set to "any" for decimal and float values.

Bind on zope.schema fields

  • Date -> date
  • DateTime -> datetime-local
  • Decimal -> number
  • Int -> number
  • Password -> password
  • Time -> time
  • URI -> url

TODO

  • add tests
  • add support of datalist

How to install

This addon can be installed has any other addons. please follow official documentation. It doesn't provide any profile, so you juste have to add it to your zope install.

If you want to support theses widgets on incapable browser you must consider using polyfill.

Some addons which provide polyfills:

  • collective.js.webshims

Credits

Companies

People