inetis-ch / oc-InputCounter-plugin

Adds configurable characters counter for text fields.

Home Page:https://octobercms.inetis.ch/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Input Counter

Adds configurable characters counter for text fields. demo

Available properties

  • data-counter (required)
  • data-min-length
  • data-max-length
  • data-optimal-min-length
  • data-optimal-max-length

Example usage

From yaml

fields:
    ...
    my_field:
        label: My Field
        type: text
        attributes:
            data-counter: true
            data-max-length: 50
    ...

From a plugin

public function boot()
{
    Event::listen('backend.form.extendFieldsBefore', function (Backend\Widgets\Form $form) {
        $form->tabs['fields']['viewBag[meta_title]'] += [
            'attributes' => [
                'data-counter',
                'data-optimal-min-length' => 50,
                'data-optimal-max-length' => 60,
            ]
        ];
    }
}

Author

inetis is a webdesign agency in Vufflens-la-Ville, Switzerland. We love coding and creating powerful apps and sites see our website.

About

Adds configurable characters counter for text fields.

https://octobercms.inetis.ch/


Languages

Language:JavaScript 52.5%Language:PHP 41.6%Language:CSS 5.9%