This project has moved and is read-only. For the latest updates, please go here.

SPRequireUnique on Edit Form

Dec 8, 2011 at 7:12 PM

I may have missed this, but this function prevents me from allowing the user to edit an item if the Title field is on the page unless they change the title to a unique value when "prevent" is turned on. The function works "too well" in this case as the user may not want or need to edit the title, but it still has to be unique if they do. It almost seems there should be some check that allows you to leave the Title alone on edit, but if you do change it, then require it to be unique. I hope that makes sense!

Dec 12, 2011 at 3:27 AM


I really built this function to be used to guarantee uniqueness of the Title column in building good cross-reference lists. Would you consider what you've found to be a bug? If so, I'll add it to the list for a fix. It would help if you could explain a bit more about how you are using the function.


Dec 12, 2011 at 11:19 AM

I have 2 forms for a few lists. They are custom data forms and one is the new form and one is the edit form. I use the function on the new form to ensure that the Title of the item is unique and this works great. Sometimes a user might realize or find out that they did not use the correct Title or they just want to change it. They may also need to edit the item without changing the Title at all. I can not allow them to have duplicate titles in these lists so I have to set the function to "Prevent" mode on the Title field. If set to prevent mode on the edit form, the OK button is automatically grayed out. The user will have to change the Title and it would have to be unique for the form to be able to submit. I think that for an edit form, the original title of the item should be removed from the check of uniqueness so that you can edit the title if needed, ensure it is unique, or leave it alone. Currently I have to write my own function for the edit form, or not allow the users to change it at all. So, I am not sure if this is a bug per se, but it could be. Was this clear as mud?