Drop down search funtion

Need help on coding search function. I get a “parsing error: unexpected token {”

import wixData from ‘wix-data’;

$w.onReady(function () {
//TODO: write your page related code here…

});

export function dropdown1_change(event) {
let searchBusinessProfessional = $w(“#dropdown1”).value;
$w(“#dataset1”).setFilter(wixData.filter().contains(“businessProfessional”, searchBusinessProfessional));
}

export function dropdown2_change(event) {
let filterStore = $w(“#dropdown2”).value;

$w(“#dataset1”).onReady( () => {

	If (filterStore === "Georgia") { 
	$w("#dataset1").setFilter(wixData.filter().eq("georgia", true)); 
	}	 

	If (filterStore === "New York") { 
	$w("#dataset1").setFilter(wixData.filter().eq("newYork", true)); 
	}  

	If (filterStore === "Florida") { 
	$w("#dataset1").setFilter(wixData.filter().eq("florida", true)); 
	}  

	If (filterStore === "South Carolina") { 
	$w("#dataset1").setFilter(wixData.filter().eq("southCarolina", true)); 
	} 

}
)}

First of all: use if not If (lower case not upper case).
̶S̶e̶c̶o̶n̶d̶,̶ ̶c̶h̶e̶c̶k̶ ̶t̶h̶e̶ ̶p̶a̶r̶e̶n̶t̶h̶e̶s̶e̶s̶ ̶i̶n̶ ̶t̶h̶e̶ ̶e̶n̶d̶ ̶o̶f̶ ̶y̶o̶u̶r̶ ̶c̶o̶d̶e̶.̶ ̶T̶h̶e̶ ̶o̶r̶d̶e̶r̶ ̶t̶h̶e̶r̶e̶ ̶s̶e̶e̶m̶s̶ ̶t̶o̶ ̶b̶e̶ ̶w̶r̶o̶n̶g̶.̶

J.D. Thank you so much for the advice and wisdom. It fixed the coding problem. I am now almost ready to launch .

Thanks again

Leroy

@leroy You’re welcome

@jonatandor35 I am getting another error this morning and my dropdown sequence is not working. Do you have any insight on the following error message

Loading the code for the Copy of 1Databa This May Be the One B… page. To debug this code, open x2uvg.js in Developer Tools.

@leroy it doesn’t look like an error message. More details are needed in order to locate the issue.

@jonatandor35 Please explain what additional things I need to put into it to make the repeater respond?
The “States” are Bolean fields

Current code is as follows:

import wixData from ‘wix-data’;
$w.onReady(function () {
//TODO: write your page related code here…
});
export function dropdown1_change(event) {
let searchBusinessProfessional = $w(" #dropdown1 “).value;
$w(” #dataset1 “).setFilter(wixData.filter().contains(“businessProfessional”, searchBusinessProfessional));
}
export function dropdown2_change(event) {
let filterStore = $w(” #dropdown2 “).value;
$w(” #dataset1 “).onReady( () => {
if (filterStore === “Georgia”) {
$w(” #dataset1 “).setFilter(wixData.filter().eq(“georgia”, true));
}
if (filterStore === “New York”) {
$w(” #dataset1 “).setFilter(wixData.filter().eq(“newYork”, true));
}
if (filterStore === “Florida”) {
$w(” #dataset1 “).setFilter(wixData.filter().eq(“florida”, true));
}
if (filterStore === “South Carolina”) {
$w(” #dataset1 ").setFilter(wixData.filter().eq(“southCarolina”, true));
}
}
)}
Both “Business/Professional” and “City” are text fields

@leroy Instead of using the export function (it easier to make mistakes there), maybe try:

$w.onReady(function () {
 $w("#dataset1").onReady( () => { 
  $w("#dropdown2").onChange((event) => {
   if (filterStore === "Georgia") {
    $w("#dataset1").setFilter(wixData.filter().eq("georgia", true));
   } 
   if (filterStore === "New York") {
    $w("#dataset1").setFilter(wixData.filter().eq("newYork", true));
   } 
   if (filterStore === "Florida") {
    $w("#dataset1").setFilter(wixData.filter().eq("florida", true));
   } 
   if (filterStore === "South Carolina") {
    $w("#dataset1").setFilter(wixData.filter().eq("southCarolina", true));
   }
  })
 })
});