@stcroppe @yisrael-wix @liran-kurtz-wix
Hi I am in the UK and am keen to see if someone can help me with one javascript support, I am new to this. I am looking to create two uuid’s and have them insert in to a database and also show on the page that has generated them. I have a dataset/collection called (Details). I have two text elements on my page to display the uuid’s #priKey and #pubKey all of what I have written so far works:
import wixData from ‘wix-data’;
import uuidv4 from ‘uuid’;
uuidv4();
function generatePriKey(item, priKey){
return uuidv4();
}
function generatePubKey(item, pubKey){
return uuidv4();
}
$w.onReady( function () {
$w(‘#createID’).onClick(() => {
$w(‘#priKey’).value = generatePriKey().toString(‘16’)
$w(‘#pubKey’).value = generatePubKey().toString(‘16’)
});
the above code shows the two uuid’s onClick within the two text elements and I thought it was as simple as connecting the text elements to the dataset? this however doesn’t work or display the uuid’s in the fields on the dataset after the onClick of a button #saveCode. Any help to achieve this would be greatly appreciated I am new to this.
Many thanks,
Simon