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

228
Views
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 answers
Answer question

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