I’m trying to create a page on my store where customers can fill out a form (which is connected to a database using a dataset) if they want to use cryptocurrency as a payment method.
So I have 3 different external links which are paired to 3 buttons (which are hidden by default) as well as a ‘Submit’ button for the form. The goal is, when someone selects a product from the dropdown and submits the form, one of the 3 buttons should show, depending on what product they selected when submitting.
In simple code it would like this:
import wixData from 'wix-data';
//Getting data from the database which is connected to the form
function getData(){
let query = wixData.query('Crypto');
return query.limit(1000).find().then(results => {
console.log('getData',results);
return results.items;
})
}
$w.onReady( () => {
//Showing the appropriate button after submitting
$w('#Cryptoform').onWixFormSubmit( () => {
if(item.value == "productA") {
$w('#buttonA').show;
}
if(item.value == "productB") {
$w('#buttonB').show;
}
if(item.value == "productC") {
$w('#buttonC').show;
}
}
}
Please suggest how I can acheive this ↑ on my page.