1

If the user chooses the first choice from column A, he sees in column B the choice 1,2,3. If the user chooses the second choice from column A, he sees in column B the choice 4,5.
Conditions:
1.I dont want to use workflows
2.I dont want to use InfoPaths
3.I want to implement this by only using Javascript validation.

I'm new to SharePoint. So please explain it clearly who knows the solution for this.

3

If you neither want to use InfoPath nor Workflow, then you have to use SharePoint web services to fetch corresponding data in Column B for a selected value in dropdown Column B.

You can achieve this functionality using SPServices library. Its a js library used to call SharePoint web services and perform operation very easily and in efficient way.

You have to write script in your Script editor webpart in Newform.aspx page

<script language="javascript" type="text/javascript" src="/address to document library/jquery-1.6.2.min.js"></script>
<script language="javascript" type="text/javascript" src="/address to document library/jquery.SPServices-0.0.6.min.js"></script>
<script language="javascript" type="text/javascript">
 $(document).ready(function() {
  $().SPServices.SPCascadeDropdowns({
   relationshipList: "Cities",
   relationshipListParentColumn: "Country",
   relationshipListChildColumn: "Title",
   parentColumn: "Country",
   childColumn: "City",
   debug: true
  });

 });
</script>

Here is the link http://www.uccorner.com/253/sharepoint/cascading-drop-down-sharepoint-foundation-2010/ for the same.

Try to download SPSerives-2013 version and JQuery-1.10.1 version. Refrence these in your webpage. As there are compatible to each other.

Alternatively, SPServices-0.6 and JQuery 1.6.2 version are compatible to each other.

After referencing these libraries, try simple function SPGetCurrentUser

    var thisUserAccount = $().SPServices.SPGetCurrentUser({
    fieldName: "Name",
    debug: false
});

And alert this thisUserAccount, If it return value then SPServices is working otherwise not. Then implement your functionality of cascade.

Reference to this link for simple example:-http://spservices.codeplex.com/wikipage?title=%24().SPServices.SPGetCurrentUser

  • Hey ateet thanks for reply.But it doest work for me :-( – Vanjith Oct 17 '14 at 13:04
  • This is basically the go to solution for cascading dropdowns in Sharepoint, the SPServices library. It does require a bit of setup to function properly. What have you done? It does not work for me doesn't really help. – Eric Alexander Oct 17 '14 at 16:38
  • You have to download SPServices library and jQuery and reference it accordingly. Be careful about conflict of JQuery library versions if it already exist in your masterpage. It cause not to work on it – ateet Oct 18 '14 at 12:44
  • I have jquery.SPServices-2014.01,jquery.SPServices-2014.01.min and jquery-1.6.2.min versions.Are they compatible? @ateet – Vanjith Oct 20 '14 at 4:12
  • 1
    yeah sure, you can refer to from cdn too! – ateet Oct 20 '14 at 8:50
0

I got success in my code. Refer this simple example here

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.