Skip to content
/ OTP_Input Public

JS/HTML UI widget for entering OTP tokens of varying length (e.g. TOTP, SMS), auto-progression, fires custom event etc. Plain javascript.

License

Notifications You must be signed in to change notification settings

fesk/OTP_Input

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OTP_Input

JS/HTML UI widget for entering OTP tokens of varying length (e.g. TOTP, SMS), auto-progression, fires custom event etc.

One Time Pad input widget, for entering numeric OTP codes (e.g. TOTP, sent-via-SMS), automatic progression between fields, raises a custom "complete" event when all fields contain a number where the 'detail' property includes property "otp_token" which is the value entered. Also allows paste (pointer/[ctrl|cmd]-v), and left-arrow or backspace to move back to previous fields

e.g.;

let tot=new OTP_Input();
tot.render(document.getElementById('otp_container_div'));
tot.instance.addEventListener('complete',function(e){
     console.log(e.detail);
})

See code for documentation, or look at example.html for a functional example;

image

No warranty or guarantee of any kind. All using plain old-fashioned javascript.

About

JS/HTML UI widget for entering OTP tokens of varying length (e.g. TOTP, SMS), auto-progression, fires custom event etc. Plain javascript.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published