Skip to main content

HTML5 forms for Django.

Project description

Author: Adam Cupiał

Contributors: Andrei Antoukh, Ben Lopatin

# Description

Formfields in django are not suited for HTML5, hence this app

# Installation

  1. clone repository git clone git://github.com/adamcupial/django-html5-forms.git, put it somewhere in your python path

  2. add ‘html5forms’ to INSTALLED_APPS (not required)

  3. use appropriate form fields in your forms (since the widgets requires some additional attributes passed from forms, you should use fields)

# Fields

## All fields

### Attributes
  • all the core attributes from django field

  • placeholder :text, which displays on the field when it is empty and unfocused

  • autofocus (true/false), automaticaly set focus to element on page load

## Html5CharField

widget: Html5TextInput

Typical CharField, most common field in the internet, allows datalist choices, which is great autocomplete feature

  • all the attr of django CharField

  • datalist: list or tuple, of words for autocompletion (sng like autocomplete in firefox or chrome)

## Html5PasswordField

widget: Html5PasswordInput

Typical PasswordField, does not allow datalist choices

  • all the attr of django CharField/PasswordField

## Html5SearchField

widget: Html5SearchInput

New field in HTML5 - the same as CharField only different input type, should be used in search fields, allows datalists

  • all the attr of django CharField/PasswordField

## Html5EmailField

widget: Html5EmailInput

## Html5UrlField

## Html5IntegerField

widget: Html5NumberInput

Attributes:
  • required = [True/False]

  • min_value

  • max_value

## Html5BooleanField

widget: Html5CheckboxInput

## Html5RangeField

widget: Html5RangeInput

Attributes:
  • same as Html5IntegerField

  • step

## Html5TelField

widget: Html5TelInput

New field in HTML5 - provides defaults for minimum and maximum length that should accept most phone numbers.

Attributes:
  • same as Html5CharField

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

html5forms-0.0.3.tar.gz (6.4 kB view details)

Uploaded Source

File details

Details for the file html5forms-0.0.3.tar.gz.

File metadata

  • Download URL: html5forms-0.0.3.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for html5forms-0.0.3.tar.gz
Algorithm Hash digest
SHA256 e90cb427ea6dc973bbd103222bd81ca493eda53c68ae72a4073ed3d6bbf16367
MD5 07b33db8240b3764d40b100f3ee984f7
BLAKE2b-256 11b2425c61339b4fa52f9249e72362ee4297206a6390aeb705e734f804c53055

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page