Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Is it possible to restrict, creation of duplicate list item in the Sharepoint 2007, using Javascript in content editor webpart to validate when an list item is added?

share|improve this question
    
Are you trying to have a unique column in the list item. How does this CEWP come into picture. Can you ellaborate the scenario? –  Thomson Sep 9 '10 at 6:50
    
I have a list, whenever an item is added to this list, the title should be unique; there shouldn't be list items with same title.. –  Anonymous Sep 9 '10 at 7:04
    
i understood the above , What are you trying to achieve using CEWP? –  Thomson Sep 9 '10 at 8:00
    
Custom code is the only way to guarantee this. JavaScript can be disabled or altered. –  Alex Angas Sep 24 '10 at 1:59

2 Answers 2

You can use the list web service via JavaScript/jQuery and validate if an item exists. I would prefer doing this on an event recevier (lot easier) but I guess you don't have a access to deploy code ? here are some samples using JS http://darrenjohnstone.net/2007/05/28/querying-a-sharepoint-list-with-JavaScript/ and here using jQuery http://weblogs.asp.net/jan/archive/2009/04/09/calling-the-sharepoint-web-services-with-jquery.aspx

share|improve this answer

It wouldn't be trivial, but you can use javascript to carry out a web service call to lookup all items with the same title.

Have a look at the SPServices JavaScript library on CodePlex.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.