Password field using R Shiny framework

后端 未结 2 1792
北恋
北恋 2021-01-04 23:07

I am planning to make a log-in for my application. For that I need a password field. I am not aware if shiny is even used for this purpose but still is it p

2条回答
  •  北海茫月
    2021-01-05 00:02

    Shiny patch to enable password handling:

    Install using library(devtools)

    install_github("shiny","alexbbrown",ref="password-field")
    

    Or download and install manually from:

    https://github.com/alexbbrown/shiny/tree/password-field
    

    Or patch your shiny manually:

    index 9b63c7b..15377d8 100644
    --- a/inst/www/shared/shiny.js
    +++ b/inst/www/shared/shiny.js
    @@ -1336,7 +1336,7 @@
       var textInputBinding = new InputBinding();
       $.extend(textInputBinding, {
         find: function(scope) {
    -      return $(scope).find('input[type="text"]');
    +      return $(scope).find('input[type="text"],input[type="password"]');
         },
         getId: function(el) {
           return InputBinding.prototype.getId.call(this, el) || el.name;
    

    Usage

    I haven't provided a convenience function to make password fields, but it can be done easily using R/Shiny html tags:

    tags$input(id="password",type="password",placeholder="Password")
    

提交回复
热议问题