Hello, I have a webpage were the user can generate a qr code based on their input, and download it. This qr code then leads to a dynamic page that shows the users inputs. I accomplish this with a QRcode library for the qr code generation part, and an iframe for the download (I send the qr code svg as a message to the iframe). My problem is that when the users clicks on the submit button, the users inputs are not being sent to the database and thus, no dynamic page is created.
Here is my code:
import { generateQRcode } from ‘backend/qrCode.jsw’ ;
import wixData from ‘wix-data’ ;
$w.onReady( function () {
$w( “#vectorImage1” ).hide
$w( ‘#html1’ ).hide
});
export function button2_click(event) {
let codeToEncode = “https://peperendon02.wixsite.com/mysite/menu/” + $w( “#input2” ).value; //use your own code
generateQRcode(codeToEncode).then(qr => {
$w( “#vectorImage1” ).src = qr;
$w( “#vectorImage1” ).show();
$w( ‘#html1’ ).show();
let toInsert = {
“title” : $w( ‘#input2’ ).value,
“thing” : $w( ‘#input3’ ).value,
“thing2” : $w( ‘#input4’ ).value,
“qr” : qr,
};
wixData.insert( “Mydatabase” , toInsert)
$w( “#html1” ).postMessage(qr);
})
}