Hi all, I am fairly new to wix and was hoping someone could tell me how to actually use information my page generates from a set of 4 conditionally filtered drop down boxes. They pull a unique combination of information from my Corvid database depending on whats selected. Its really cool that it works, but how can I actually capture/transpose the unique inquiry to a contact form with something like a “Request Quote” button.
Thanks in advance
Here is the test webpage:
https://grant53787.wixsite.com/mysite-3/flyers-02
This the spreadsheet I am using for the database
Here is the Code I adapted from a tutorial:
import wixData from ‘wix-data’ ;
$w.onReady( function () {
uniqueDropDown1();
});
function uniqueDropDown1 (){
wixData.query( “flyers-02” )
.limit( 1000 )
.find()
.then(results => {
const uniqueTitles = getUniqueTitles(results.items);
$w( “#dropdown1” ).options = buildOptions(uniqueTitles);
});
function getUniqueTitles(items) {
const titlesOnly = items.map(item => item.size);
return [… new Set(titlesOnly)];
}
function buildOptions(uniqueList) {
return uniqueList.map(curr => {
return {label:curr, value:curr};
});
}
}
export function dropdown1_change(event, $w) {
uniqueDropDown2();
$w( “#dropdown2” ).enable();
}
function uniqueDropDown2 (){
wixData.query( “flyers-02” )
.contains( “size” , $w( “#dropdown1” ).value)
.limit( 1000 )
.find()
.then(results => {
const uniqueTitles = getUniqueTitles(results.items);
$w( “#dropdown2” ).options = buildOptions(uniqueTitles);
});
function getUniqueTitles(items) {
const titlesOnly = items.map(item => item.processing);
return [… new Set(titlesOnly)];
}
function buildOptions(uniqueList) {
return uniqueList.map(curr => {
return {label:curr, value:curr};
});
}
}
export function dropdown2_change(event, $w) {
uniqueDropDown3();
$w( “#dropdown3” ).enable();
}
function uniqueDropDown3 (){
wixData.query( “flyers-02” )
.contains( “processing” , $w( “#dropdown2” ).value)
.limit( 1000 )
.find()
.then(results => {
const uniqueTitles = getUniqueTitles(results.items);
$w( “#dropdown3” ).options = buildOptions(uniqueTitles);
});
function getUniqueTitles(items) {
const titlesOnly = items.map(item => item.paperMaterial);
return [… new Set(titlesOnly)];
}
function buildOptions(uniqueList) {
return uniqueList.map(curr => {
return {label:curr, value:curr};
});
}
}
export function dropdown3_change(event, $w) {
uniqueDropDown4();
$w( “#dropdown4” ).enable();
}
function uniqueDropDown4 (){
wixData.query( “flyers-02” )
.contains( “paperMaterial” , $w( “#dropdown3” ).value)
.limit( 1000 )
.find()
.then(results => {
const uniqueTitles = getUniqueTitles(results.items);
$w( “#dropdown4” ).options = buildOptions(uniqueTitles);
});
function getUniqueTitles(items) {
const titlesOnly = items.map(item => item.refining);
return [… new Set(titlesOnly)];
}
function buildOptions(uniqueList) {
return uniqueList.map(curr => {
return {label:curr, value:curr};
});
}
}
export function dropdown4_change(event) {
// Add your code for this event here:
}