Skip to main content

A widget to have a django text input splitted into multiple HTML inputs.

Project description

django_splitted_input

About

This is a django widget for multiple fixed size inputs for one form field. These could be used for those super fancy verification code forms. The cursor is moved to the next input field using JS/jQuery.

django_splitted_input Showcase

Usage

  1. Install django_splitted_input and add it to your INSTALLED_APPS.

    pip install django-splitted-input
    

    In your settings.py:

    "django_splitted_input",
    
  2. Install jQuery using your preferred method (e.g. django-yarnpkg)

  3. Create a form with a CharField.

  4. Use SplittedInput as a widget and supply the sizes of all input fields.

from django import forms
from django_splitted_input import SplittedInput


class VerificationForm(forms.Form):
    auth_code = forms.CharField(label='Code', widget=SplittedInput(sizes=(3, 3, 3)))

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

django-splitted-input-0.1.0.tar.gz (2.6 kB view hashes)

Uploaded Source

Built Distribution

django_splitted_input-0.1.0-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

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