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

How can I restrict the number of values a user can select from a lookup column? It doesn't seem to have the same column validation settings as some of the other column types.

I only want a user to be able to select two values maximum using a lookup form field when creating a new item, but I need them to be able to pull the values from another list which is too long and too regularly updated to use a Choice column.

share|improve this question

1 Answer 1

Not possible out-of-the-box, but you could envision changing the edit form and either use InfoPath edit form with Rules or create the edit form in SharePoint designer (http://office.microsoft.com/en-001/sharepoint-designer-help/create-a-custom-list-form-using-sharepoint-designer-HA010378258.aspx), where you would have total freedom in adding your Javascript based rules. - the major issue is reusability (in case you plan to use the same in other places).

Alternativelly, if you still want to stay away from SPD 2010, you could edit the page hosting the Editing Web part (just append the query string between the quotes "&PageView=Shared&ToolPaneView=2" which will allow you to jump in Editing Web parts on regular list forms) and inject via a CEWP some javascript (http://blogs.msdn.com/b/sharepointdev/archive/2011/04/14/using-the-javascript-object-model-in-a-content-editor-web-part.aspx), which you could store in Site Assets.

If reusability is an issue, you need to opt for building your own Custom field which could give you total freedom (but adds complexity).

share|improve this answer
    
Thanks. It's already on a custom list form, and I have no concerns about reusability I think this is a one off solution for a specific problem. However while I am comfortable in SPD 2010 I am not all that familiar with JS. Could you point me towards where I need to add the javascript for your option 'Edit form in the sharepoint designer' and what that script looks like/syntax required for sharepoint? –  NLWaddell Apr 3 '13 at 12:19
    
i've edited my answer use "&PageView=Shared&ToolPaneView=2" to be able to add WP, and then simply use generated control identifiers to target controls to change. Put the scripts in some library on the site and load them from there via CEWP. –  C. Marius - MVP Apr 3 '13 at 14:16

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.