Hi,
I have a project where item should be added to a list but we want to prevent duplicates, I have created a jquery function that add item to the list but I want to create a function that verifies that the item is not already in the list an call that function within my jquery add function.
My searchduplicate function will return true if duplicate is found and false otherwise. I want to use the returned in my addtolist function to wether add the item or show a "item is already in the list" error message.
Does this make sense? if yes please help design that.
Your help is appreciated.
Thank you!

Rijwan AnsariRank #82 · 24.2K reputationPosted Mar 16, 2021, 1:05 PM EDT
Jignesh KumarRank #91 · 22.9K reputationPosted Mar 16, 2021, 3:46 AM EDT
Schleid AlexRank #3,087 · 464 reputationPosted Mar 16, 2021, 4:38 AM EDT
Schleid AlexRank #3,087 · 464 reputationPosted Mar 16, 2021, 4:52 AM EDT
url: 'SearchDuplicates',
dataType: 'html',
//contentType: 'apllication/html; charset=utf-8',
data: { upc: prUPC },
type: 'GET',
cache: false,
success: function (data) {
return data
}
})