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

77
Views
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 answers
Answer question

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