Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

239
Vistas
While toggle, show/ hide numeric key pad changed to alpha-numeric keypad

In mobile, when inserted pin number, and then toggle show/hide then numeric key pad also changed to alphanumeric keypad. I required, when I toggle show/hide button it should be only display numeric keypad

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>

<section ng-app="myApp" ng-controller="mainCtrl">
  <input type="{{inputType}}" placeholder="Put your pin" inputmode="numeric" />
  <input type="checkbox" id="checkbox" ng-model="passwordCheckbox" ng-click="hideShow()" />
  <label for="checkbox" ng-if="passwordCheckbox">Hide Pin</label>
  <label for="checkbox" ng-if="!passwordCheckbox">Show Pin</label>  
</section>
<script src="https://code.angularjs.org/1.2.13/angular.min.js"></script>

</body>
</html>

and js file is

    var myApp = angular.module('myApp', []);
myApp.controller('mainCtrl', ['$scope', function( $scope ){
  
  // Set the default value of inputType
  $scope.inputType = 'password';
  
  // Hide & show pin function
  $scope.hideShow = function(){
    if ($scope.inputType == 'password')
      $scope.inputType = 'text';
    else
      $scope.inputType = 'password';
  };
  
}]);

and css

section {
  background: #fff;
  box-shadow: 2px 2px 0 1px rgba(0, 0, 0, .1);
  margin: 3em auto;
  padding: 2em;
  width: 600px;
}
input {
  font-size: 1em;
  padding: 1em;
}
  1. when entering pin it shows numeric keypad
  2. when toggle show numeric keypad change to alphanumeric keypad

how to show only numeric key pad while toggling button?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You could simply set the text input type to be number instead of text.

  // Hide & show pin function
  $scope.hideShow = function(){
    $scope.inputType = $scope.inputType == 'password' ? 'number' : 'password';
  };
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda