Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

334
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda