Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

231
Views
Mientras alterna, mostrar/ocultar teclado numérico cambiado a teclado alfanumérico

En el móvil, cuando se inserta el número de PIN, y luego alternar mostrar/ocultar, el teclado numérico también cambia a teclado alfanumérico. Lo requería, cuando alterno el botón mostrar/ocultar, solo debería mostrar el teclado numérico

 <!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>

y el archivo js es

 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'; }; }]);

y 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. al ingresar pin muestra teclado numérico
  2. cuando alternar mostrar teclado numérico cambia a teclado alfanumérico

¿Cómo mostrar solo el teclado numérico mientras se alterna el botón?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Simplemente puede configurar el tipo de entrada de texto para que sea un number en lugar de texto.

 // Hide & show pin function $scope.hideShow = function(){ $scope.inputType = $scope.inputType == 'password' ? 'number' : 'password'; };
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!