Error: SPServices is not null or not an object Line 542

Dec 10, 2009 at 4:18 PM

Hi, i tried to implemet a cascading functionallity to my dropdown.

but when i run the code i get the following error: SPServices is not null or not an object Line 542.

any1 knows a solution?

thx;)

my code:

<script language="javascript" type="text/javascript" src="../../javascript/jquery.SPServices-0.4.1.min.js"></script>

 <script language="javascript" type="text/javascript" src="../../javascript/jquery-1.3.2.min.js"></script>


<script type="text/javascript">
alert("Hello World");
$(document).ready(function() {

 $().SPServices.SPCascadeDropdowns({
  relationshipList: "States",
  relationshipListParentColumn: "Region",
  relationshipListChildColumn: "Title",
  parentColumn: "Region",
  childColumn: "State",
                debug: true
 });
});
 </script>

Coordinator
Dec 10, 2009 at 4:24 PM
Edited Dec 10, 2009 at 4:24 PM

You need to reverse the two references: jQuery needs to come before SPServices.  Also, put the Hello World alert inside the $(document).ready(function().  That will tell you if your references are correct.

M.

Dec 11, 2009 at 7:18 AM

Thanks for the answer! ok i made the changes now i'm getting a new error:

Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

 

any idea waht i did wrong??

Dec 11, 2009 at 7:44 AM

Ok now i fix that. But still no cascading.

my tables:

Region

Column: Title(region name)

States

column : Title(not used), State, Region(Look up to region name)

Sales Opportunities

column: Title(not used) ,Region(Look up to region name), Satate(Look up to state)

code:

<script language="javascript" type="text/javascript" src="../../javascript/jquery-1.3.2.min.js"></script>
<script language="javascript" type="text/javascript" src="../../javascript/jquery.SPServices-0.4.1.min.js"></script>

 


<script type="text/javascript">

$(document).ready(function() {
alert("Hello Tasha");
 $().SPServices.SPCascadeDropdowns({
  relationshipList: "States",
  relationshipListParentColumn: "Region",
  relationshipListChildColumn: "State",
  parentColumn: "Region",
  childColumn: "State",
                debug: true
 });
});
 </script>

Dec 11, 2009 at 7:57 AM

Sorry i´m stupid i got a typo:-)

everything is working!

thanks.

Coordinator
Dec 11, 2009 at 11:42 AM

Great! Let me know if you have any more questions.

M.

Aug 12, 2010 at 1:25 PM
semapolix wrote:

Thanks for the answer! ok i made the changes now i'm getting a new error:

Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

 

any idea waht i did wrong??

 

 

How did you fix this?