Hello, im triying to send a random generated number in a input to a database. after sending the random code i look into de database but that field is empty.
i have try the code from here https://www.wix.com/velo/forum/community-discussion/solved-i-need-a-help-of-a-wix-expert.
But i dont know how to connect it .
The code is in that input and is sent when is clicked the “vale de comida” button.
Taht my code:
function RandomString() {
var x = '';
RandomString = ("BRC"+Math.random().toString(36).substring(2, 16) + Math.random().toString(36).substring(2, 16));
x = RandomString.toString();
return x;
}
export function page1_viewportEnter(event) {
$w('#input19').value = RandomString();
}
that is the code that i have in data.js:
function Vales_beforeInsert(item,code) {
let hook = code;
item.code = (I DONT KNOW RHAT TO PUT HERE) ;
return item;
}
¿How can i connect all to send the random code properly to the database?