kaito
Member
Hi everybody !!
I have a form with (there are other fields, but the relevant ones are the following):
- button: that opens a new window and run a javascript that let you scan a QR code (this is the link I have used https://learncodeweb.com/jquery/how-to-use-instascan-an-html5-qr-scanner/ it woks ok if someone else want to use it). QR code is stored into var content
- Field element: read only
In the new window opened for the QR scanner, I store QR code into variable content. Then, I assign this var to sessionStorage.setItem("qrleido",content);
But I don´t know how to update field element using , in the form page, with value comming from sessionStorage.getItem("qrleido"). Any clue about how to retrieve that value?
Thanks in advance,
I have a form with (there are other fields, but the relevant ones are the following):
- button: that opens a new window and run a javascript that let you scan a QR code (this is the link I have used https://learncodeweb.com/jquery/how-to-use-instascan-an-html5-qr-scanner/ it woks ok if someone else want to use it). QR code is stored into var content
- Field element: read only
In the new window opened for the QR scanner, I store QR code into variable content. Then, I assign this var to sessionStorage.setItem("qrleido",content);
HTML:
<script type="text/javascript">
var audio = new Audio('https://media.geeksforgeeks.org/wp-content/uploads/20190531135120/beep.mp3');
var scanner = new Instascan.Scanner({ video: document.getElementById('preview'), scanPeriod: 5, mirror: false });
scanner.addListener('scan',function(content){
audio.play();
sessionStorage.setItem("qrleido", content);
alert(content);
window.close();
});
</script>
But I don´t know how to update field element using , in the form page, with value comming from sessionStorage.getItem("qrleido"). Any clue about how to retrieve that value?
Thanks in advance,