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

230
Vistas
How to make validation in html to allow only two characters

I have an input field:

<input name="onkirmizi[]" type="text" class="form-control" tabindex="1" >

And I want to give this input field validation which only allows 2 characters allowed. So in this point, I have two questions.

  1. Do I need to put it inside of the form?
  2. Do I need to add js file (if so how can I do that)?
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Attribute maxlength

Accepts a positive integer

When this number is reached during dialing, no further input is possible.

<!DOCTYPE HTML>
<html>
 <head>
  <meta charset="utf-8">
  <title>Tag INPUT, attr maxlength</title>
 </head>
 <body>

  <form  action="handler.php">
   <p><input type="text" maxlength="2"></p>
   <p><input type="submit" name="submit" value="Submit"></p>
  </form> 

 </body>
</html>
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