Closed mikecasas closed 1 year ago
I changed the js in qrcode-init.js to just grab the element and clear the contents before it regenerates the code
function initQrCode(elementId, text, width, height) {
var ele = document.getElementById(elementId);
if (ele != null) {
ele.replaceChildren();
}
new QRCode(ele,
{
text: text,
width: width,
height: height
});
}
@DannyRichardsonWG Thanks so much. It worked perfectly.
Thanks for the great control. When I use it in my app, I have a button and a textbox where users can enter their id number and it creates the QR code perfectly. If they enter multiple id's there are multiple QR codes down the page. Is there a way to clear the current QR code and then refresh it with the new text?