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

335
Views
I'm working on a form and it is necessary that when the user enters the input field Име and exit to appear below the text and border orange color

I'm working on a form and it is necessary that when the user enters the input field Name and exit to appear below the text and border orange color

$(function() {
  $('#imeprezime1').on('blur', function(e) {
    var provera = /^[A-ZČĆŠĐŽ]{0,1}([a-z]+)\s{0,1}[a-z]{4,180}$/.test($(this).val());
    if (provera === true) {
      $(this).css('outline', '0px solid');
    } else {
      $(this).css('outline', '4px solid orange');
      $(this).after('<span>Test</span>' + "<br>");
    }
  });
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<div class="forma">
  <form class="form" id="form">
    <div class="input-polja">
      <label>Име и презиме</label>
      <input type="text" placeholder="Овде унети име и презиме" name="imeprezime" id="imeprezime1">
      <label>Имејл</label>
      <input type="text" placeholder="Овде унети имејл" name="mejl" id="imejl1">
      <label>Телефон</label>
      <input type="text" placeholder="Овде унети телефон" name="telefon" id="telefon1">
      <label>Лозинка</label>
      <input type="password" placeholder="Овде унети лозинку" name="password1" id="lozinka1">
      <label>Поновљена лозинка</label>
      <input type="password" placeholder="Овде унети поновљену лозинку" name="password2" id="lozinka2">
    </div>
    <button type="submit">Региструј се</button>
  </form>
</div>

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

0

Misliš na ovo? :)

$(function() {
  $('#imeprezime1').on('blur', function(e) {
    var provera = /^[A-ZČĆŠĐŽ]{0,1}([a-z]+)\s{0,1}[a-z]{4,180}$/.test($(this).val());
    if (provera === true) {
      $(this).css('outline', '0px solid');
    } else {
      $(this).css('outline', '4px solid orange');
      $(this).after(`<span>Test</span><br>`)
    }
  });
  
  $('#imeprezime1').on('focus', function(e) {
      $(this).next("span").remove();
      $(this).next("br").remove();
  });
 
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<div class="forma">
  <form class="form" id="form">
    <div class="input-polja">
      <label>Име и презиме</label>
      <input type="text" placeholder="Овде унети име и презиме" name="imeprezime" id="imeprezime1">
      <label>Имејл</label>
      <input type="text" placeholder="Овде унети имејл" name="mejl" id="imejl1">
      <label>Телефон</label>
      <input type="text" placeholder="Овде унети телефон" name="telefon" id="telefon1">
      <label>Лозинка</label>
      <input type="password" placeholder="Овде унети лозинку" name="password1" id="lozinka1">
      <label>Поновљена лозинка</label>
      <input type="password" placeholder="Овде унети поновљену лозинку" name="password2" id="lozinka2">
    </div>
    <button type="submit">Региструј се</button>
  </form>
</div>

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!