0

setting up various "Views" in my custom document library. I'm trying to make the uploading of materials extremely intuitive for my team. I have two specific "choice" drop down fields and I am trying to make the second field dependent on the first.

For Example: Am I able to set up the columns so that if someone selects "Account Planning" in the first dropdown than the second drop down has DIFFERENT drop down variables then if they were to have picked "Business Planning"?

0

If you don't mind using a little bit of JavaScript - you can do it by using SPServices library that does just that.

There is SPCascadeDropdowns function that does what you want.

Here is an example:

<script language="javascript" type="text/javascript" src="../../jQuery%20Libraries/jquery-1.8.2.js"></script>
<script language="javascript" type="text/javascript" src="../../jQuery%20Libraries/jquery.SPServices-0.7.2.min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
  $().SPServices.SPCascadeDropdowns({
    relationshipList: "Regions",
    relationshipListParentColumn: "Country",
    relationshipListChildColumn: "Title",
    CAMLQuery: "<Eq><FieldRef Name='Status'/><Value Type='Text'>Active</Value></Eq>",   parentColumn: "Country",
    childColumn: "Region",
    debug: true
  });
  $().SPServices.SPCascadeDropdowns({
    relationshipList: "States",
    relationshipListParentColumn: "Region_x0020_Name",
    relationshipListChildColumn: "Title",
    relationshipListSortColumn: "ID",
    parentColumn: "Region",
    childColumn: "State"
  });
});
</script>

There are a lot of settings so it's better just to look through all possible options in the documentation page.

Update: For this to work, you need to add a Content Editor Web Part (CEWP) to the "NewForm.aspx".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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