Coder Social home page Coder Social logo

tobz-nz / x-password Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 0.0 23 KB

custom-element (web component). password field with a toggle visiblity switch to hide/show the password value.

Home Page: http://tobz-nz.github.io/x-password/

HTML 32.92% JavaScript 67.08%
ja password-input webcomponents

x-password's Introduction

A password input natively enhanced via a Custom Element (Web Component).

It adds the ability to toggle visibility and validation to confirm it matches the value of another field

Demo

Check it live.

Usage

<script src="https://tobz-nz.github.io/x-password/x-password.js" type="module"></script>

<form onsubmit="return false">
    <label for="password">Password</label>
    <input type="password" name="password" id="password">

    <br>

    <label for="password_confirm">Confirm Password</label>
    <input is="x-password" name="password_confirm" id="password_confirm" confirm-target="password">
    <button type="button" onclick="document.getElementById('password_confirm').toggleAttribute('visible')">Toggle Visibility</button>

    <br>  
  
    <button>Go</button>
</form>

Options

Attribute Options Default Description
visible - null Set the value to visible (plain text)
confirm-target string null The ID of another field to match

History

  • v0.2 Jan 9, 2024
    • re-release as fully native web-component
  • v0.1 Feb 5, 2014
    • initial release

License

MIT License

x-password's People

Contributors

tobz-nz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

x-password's Issues

Getting Error on Demo Page

 Uncaught TypeError: Cannot read property 'call' of undefined
polymer.js:29 Uncaught ReferenceError: PolymerExpressions is not defined
x-password.html:34 Uncaught TypeError: object is not a function

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.