The only way to do this if you don’t want to use the built in method is to have a query that runs pre-save to check for duplicate values. This is pretty straight forward if the list does have to many items. If you exceed a few thousands items, the query would slow down the save process because it has to wait for the query to return.
Basically you can use something like this in your custom js:
function dffs_PreSaveAction(){
var res = spjs.utility.queryItems({
"listName": _spPageContextInfo.pageListId,
"query": ""+getFieldValue("Title")+""
});
if(res.count > 0){
spjs.dffs.alert({
"title": "Duplicate value",
"msg": "An item with this title already exist, please change the value and try again.",
"ok": function(){
// Close dialog
}
});
return false;
}
return true;
}
Alexander