On GitHub
Fix Bugs or Add Features

Welcome to Bootstrap Password Toggler

Introduction

Bootstrap Password Toggler is a very simple but effective jQuery plugin for showing/hiding password. It fully support Bootstrap v4.

Download

Help us find bugs, add new features or simply just feel free to use it. Download Bootstrap Password Toggler from our  GitHub site.

License

The MIT License (MIT)

Copyright (c) 2017, canchito-dev

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Dear haters, trolls and everything-sucks-people...

This project started as a way of helping me understand and learn about jQuery plugin. It might not perfectly coded, but it was developed with all the good intensions at heart.

This is a totally unpaid and voluntary project, developed during my free-time and shared on GitHub. It can be used for private or commercially, without a cost. There is only one simple request, do not bash or complain. If you don't like it, don't use it.

If you find an issue, please fill free and open a ticket, we will try to solve it as soon as possible. If you would like to become an active contributor to this project, even better.

Contribute Code

If you would like to become an active contributor to this project please follow theses simple steps:

  1. Fork it
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create new Pull Request

User Guide

The plugin can be used with input elements. Typically password fields. There are two ways to initialize the plugin: (1) via attributes; (2) via JavaScript.

<input class="form-control" id="password" name="password" placeholder="Password" data-toggle="password">						

Via Data Attributes

<input data-toggle="password">						

Via JavaScript

$('#password').password();						

Options

Options can be passed via data attributes or JavaScript.

Name Attribute type default description
- data-toggle String password Enables password plugin without writing JavaScript
append data-append String right Appends the show/hide icon. Possible values are 'right' or 'left'
tooltip data-tooltip String Show/Hide password The tooltip of show/hide icon
iconPrefix data-icon-prefix String fa Base eye icon class
iconShow data-icon-show String fa-eye Open eye icon
iconHide data-icon-hide String fa-eye-slash Close eye icon
debug data-debug Boolean true Enables/Disable debugging mode

By default, the icons used are from Font Awesome.

When the debug mode is enabled, the plugin will log in the console the event's related information.

Events

Additionally, the plugin exposes some events.

Event Type Description
show.bs.password This event fires immediately when a request to show the password is sent
shown.bs.password This event fires immediately after the password has been shown
hide.bs.password This event is fired immediately when a request to hide the password is sent
hidden.bs.password This event is fired immediately after the password has been hidden