I am trying to write a code that goes through a dataset and disable the addition of any entry that is identical to an entry already existing in the dataset by disabling the add button. I keep getting an error at the else line.
I am really new to coding so I would really appreciate your help.
function filter ( class1 , title ) {
let new filter = wixData . filter ();
if ( class1 ) {
new filter = new filter . contains ( “Class1” , class1 )
}
if ( title ) {
new filter = new filter . contains ( “First Name” , title )
}
$w ( “#dataset1” ). setFilter ( newfilter );
function onChange() {
$w ( “#button1” ). disable ()
else {
$w ( “#button1” ). enable ();
}
}