I have done a project on building a QR Code scanner using Javascript , the value of qr was returned in a js variable. Now i cannot pass the value to django backend for futher operations My JS code
<h4>SCAN RESULT</h4>
<div id="result">Result Here</div>
function onScanSuccess(qrCodeMessage) {
document.getElementById('result').innerHTML = '<span class="result">'+qrCodeMessage+'</span>';
}
I tried using Buttons instead of div so that clicking the button passes the button value to backend
<button type="submit" id="result" name="xyz">QR VALUE</button>
and in views.py
def qrscanner(request): obj=request.POST.get("xyz") print(obj) return render(request,"qr_scanner.html")
and this didn't succeed either, is there any way i could pass the qr value to django views