Case description:
You have pair of fields. One field (field2) depends on value of second one (field1). You want to realize that functionality on form new and edit form.
Resolution
Use prepared javascript-based solution “SharePoint Cascade Lookups” or InfoPath. We chose the first variant as the way we can apply for Sharepoint 2010 Standard Edition.
1. Download script and upload it to Sharepoint library
2. Create list with field1 values (list1 )
Name: List1
Columns: Title1 (field1 value)
3. Create list with field2 values
Name: List2
Columns:
1. Title2 (field2 value)
2. Field2 (lookup to List1)
4. Add to required list (“ListWithFunctionality”) lookup fields. Fields refers to List1 and List2 (FieldToList1DisplayName, FieldToList2DisplayName)
5. Add to New and Edit forms of required list (“ListWithFunctionality”) HTML form webpart.
6. Edit content of newly added webpart with following text.
<script type=”text/javascript” src=”/pathToScript/spcd.js”></script>
<script type=”text/javascript”>
var ccd1 = new cascadeDropdowns(“FieldToList1DisplayName”, “FieldToList2DisplayName”, “Field2″, “List2″, “Title2″);
</script>
The main moments here are:
- Set “HTML form web part” with script lines after “New/Edit list form”
- 1st and 2nd parameter of cascadeDropdowns objects are DisplayNames of the fields, 3rd and 5th are internal names
Some links:
