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

116
Vistas
Alert keeps showing either inputs are correct

Alert is keep showing either I enter the correct input as required. Concept is, When I enter the serial numbers, serial numbers must be 6 digits(no less than 6 or more than 6). Alert must be shown if I enter less or more than 6 digits numbers as "Serial Numbers must be the same.". Current problem is if I only insert 1 (6 digits) serial number, it works. But, if I insert 2 serial numbers (If I hit enter, known as inserting another new serial number), that "Serial Number Must be the same." alert is keep showing. I think Javascript error I guess but I don't know how to fix it.

    var barcodeno = document.translot.barcodeno.value;
      if (barcodeno == ""){
          alert("Please Insert Serial Numbers.")
          return false;
      }
      else if (barcodeno.length != 6 ){
          alert ("Serial Numbers must be 6 digits.")
          return false;
      }
  

  $('#filter').html(''); // to clear selection
  // lotid = $('#lotid').val().split('\n');
  var barcodeno = $('#barcodeno').val().trim();
  barcodeno = barcodeno.split('\n');
//checking duplicate barcodeno
    let barcodeno_array = []
    for(let i = 0;i < barcodeno.length; i++){
        if(barcodeno_array.indexOf(barcodeno[i]) == -1){
            barcodeno_array.push(barcodeno[i])
        }
    }
    

  var Barcode = barcodeno_array.length;
  //alert (Barcode+'||'+seal_qty);
  if (seal_qty != Barcode){
      alert ("Seal Quantity and Number of BarcodeID must be the same.");
      return false;
  }

Above is JavaScript.

$barcode_name = "Seal Number:";
            $barname = "placeholder=\"Scan the Serial Number\"";    
<label class="control-label col-sm-4" for="barcodeno"><?php echo $barcode_name; ?></label>
      <div class="col-sm-4">
        <p class="form-control-static" style="margin-top: -6px;">
            <textarea class="form-control" rows="10" id="barcodeno" name="barcodeno" onkeydown="return KeyDown()" onkeyup="this.value=this.value.toUpperCase()" <?php echo $barname; ?>></textarea>
            
        </p>
      </div>
      <br>
about 4 years ago · Juan Pablo Isaza
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