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

293
Vistas
how to add xxxxx format in inputmask with html input pattern?

Input mask is by default '_ _ _ _ _' this format with html pattern. My requirement is in zipcode input, I want to change above pattern to 'xxxxx' this format.

here is my code

<input type="text" id="zipcode" pattern="[0-9]{5}" minlength="5" maxlength="5" required />

js code

$('#zipcode').inputmask('99999');
// if I give number format in input mask, it is working good with '_ _ _' this format. But I want to show 'x' format.

$('#zipcode').inputmask('xxxxx');

Is there any way to change the format from _ to x enter image description here

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

0

You can pass in options to override the default underscore - https://github.com/RobinHerbots/Inputmask#placeholder-1

$('#zipcode').inputmask('99999',{ "placeholder": "x" })

about 4 years ago · Juan Pablo Isaza Denunciar

0

You could try changing pattern="[0-9]{5}" to pattern="x{5}"

My guess is that the library you're using (inputmask) is setting the default mask of _____. The pattern="[0-9]{5}" option allows a series of 5 digits which is why if you "give number format in input mask, it is working good."

A site like rubular might be a fun playground to see what's going on.

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