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

83
Vistas
Javascript input text onchange by other script

Been searching a way to detect real time change on the input but not changed by user which is changed by also a code

Example: QR Scanned(not my code lib. only) > text output will go to certain text input > when text changed it throws an alert and nothing will happen if there's no scanned or the value is recent scanned.

My current progress to that code is pasted below, it is not working unless it was change by user qr text output is working but alert not working since it will no get triggered by the "change".

  $("#UUID").on("change", function(e) {
    var UUID = document.getElementById("UUID").value;
    if ("SCANNING" != UUID) {
        alert(UUID);
    }

  });

the idle value of text input is "SCANNING" thats why i left the if else statement != "SCANNING" so it will throw alerts when not getting scan by other output/value. Hoping to get help in not throwing alerts to when scanning the same value so it won't spam alerts.

Here's a video demo of the scanner via Imgur

  • https://i.imgur.com/UlFMsPz.mp4
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I finally solved it, I was looking for the functionality of throwing the text value of qr text output and created a global variable and added a call function line in the end of the qr text output then send the variable of it to the internal js.

So here's the code line i modified from the QR scanner:

var ScannedUUID; //created global variable
function read(a)
{
    var html="<br>";
    if(a.indexOf("http://") === 0 || a.indexOf("https://") === 0)
        html+="<a target='_blank' href='"+a+"'>"+a+"</a><br>";
    html+="<b>"+htmlEntities(a)+"</b><br><br>";
    document.getElementById("result").innerHTML=html;
    document.getElementById("UUID").value= a;
    ScannedUUID; = a; //set the qr text out value to global
    scannedTransfer(); //call the function from the index.html      
}   

Here's the index.html:

<script type="text/javascript" src="./webqr.js"></script>
<script>
  function scannedTransfer(){
    //so created a local variable for new variable of out global
    var UUID = ScannedUUID;
    //added some output for testing
    console.log("Working, Scanned: " + UUID)
    alert(UUID);
  }
</script>
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