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

337
Vistas
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 Respuestas
Responde la pregunta

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