Uncaught TypeError: Cannot read property 'SPCascadeDropdowns' of undefined

Feb 3, 2015 at 12:36 PM
Edited Feb 3, 2015 at 1:40 PM
Iam using Sharepoint 2010 and in List Custom new form i am trying to use SPCascadedropdown. I am getting this error

Uncaught TypeError: Cannot read property 'SPCascadeDropdowns' of undefined NewForm.aspx?RootFolder=&IsDlg=1:676
(anonymous function) jquery.min.js:2
k jquery.min.js:2
l.fireWith jquery.min.js
:2 p.extend.ready jquery.min.js:2 D

My Javascript in newform looks like this
<script language="javascript" type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script language="javascript" type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/2013.01/jquery.SPServices-2013.01.min.js"></script>
  <script language="javascript" type="text/javascript">
$(document).ready(function() {
$().SPServices.SPCascadeDropdowns({
    relationshipList: "{19547124-1F79-481D-A47B-C1988EEA52FC}",
    relationshipListParentColumn: "AccountingUnit",
    relationshipListChildColumn: "CostCentreID",
    parentColumn: "Buchungskreis",
    childColumn: "Kostenstelle",
    debug: false
  });
  $().SPServices.SPCascadeDropdowns({
    relationshipList: "{DC91D4D6-1841-4B3E-9815-C32BD6F33D73}",
    relationshipListParentColumn: "AccountingUnit",
    relationshipListChildColumn: "ImpersonalAccountID",
    parentColumn: "Buchungskreis",
    childColumn: "Sachkonto",
    debug: false
  });
  
});
</script>
am i doing something wrong.


If i use the same code in Custom edit form is working :( .. Nothing new in Custom new form i have made.
Feb 3, 2015 at 6:36 PM
I added the code at the Contentplaceholdermain then it worked. It took for me 1 whole day to figure it out... anyway finally it worked..
Marked as answer by dineshde on 2/3/2015 at 11:36 AM
Coordinator
Feb 4, 2015 at 1:15 PM
It sounds like SPServices wasn't loading before you called SPCascadeDropdowns.

BTW, you should upgrade to the latest versions of jQuery and SPServices.

M.