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

172
Views
Jquery de enfoque

obtuve la etiqueta de errore cuando ejecuté esto ya que uso un selector de tiempo con un control de punto compartido de campo de formulario, así que

este es mi codigo de validacion jquery

 $("input[id*='ffEnTime']").focusout(function () { if ($("input[id*='ffEnTime']").val().trim() == "") { $("span[id*='lblEntTime']").show(); $("span[id*='lblEntTime']").text("Write Entry Time"); } else { $("span[id*='lblEntTime']").hide(); } });

y el código de timepicker que uso

 $(document).ready(function () { //Start Validation at the after form loaded $("input[id*='ffPltNo']").attr("maxlength", "4"); $("input[id*='ffIDNumber']").attr("maxlength", "10"); $("input[id*='ffEnTime']").attr("autocomplete", "off"); $("input[id*='ffEnTime']").attr("readOnly", "true"); $("input[id*='ffEnTime']").timepicker({ timeFormat: 'hh:mm p', minTime: '06:30:00', // 11:45:00 AM, maxHour: 24, maxMinutes: 30, startTime: new Date(0, 0, 0, 06, 0, 0), // 3:00:00 PM - noon interval: 30 });

entonces se ve así Ver foto

el error viene porque cuando hago clic en cualquier momento para elegir, primero se enfocará, luego se ejecutará la validación, finalmente elegirá el momento en ese caso, tengo que elegir nuevamente para que la etiqueta desaparezca

alguna sugerencia para reemplazar focus out con algo mejor?

Probé el cambio pero no funciona conmigo.

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

0

lo intentaste

 $("input[id*='ffEnTime']").on('input',function () { //your validation function here })
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!