Cannot save new item form using SPServices.SPFilterDropdown, SPServices.SPCascadeDropdowns

Jul 8, 2015 at 5:33 PM
Edited Jul 8, 2015 at 5:35 PM
Using the following versions of JQuery and SPServices:

<script type="text/javascript" src="/siteassets/jquery/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="/SiteAssets/spservices/jquery.SPServices-2014.02.min.js"></script>


They drop downs and cascading works fine just when I try to save the form I receive the following error messages in ULS.

___MetadataNavigationContext Page_InitComplete: No XsltListViewWebPart was found on this page[/stations/Lists/StationProfiles/NewForm.aspx?Source=***AllItems%2Easpx&RootFolder=]. Hiding key filters and downgrading tree functionality to legacy ListViewWebPart(v3) level for this list.

System.ArgumentException: 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.
at System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument)
at System.Web.UI.WebControls.DropDownList.LoadPostData(String postDataKey, NameValueCollection postCollection)
at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


Thanks,
-E
Coordinator
Jul 8, 2015 at 8:42 PM
Hard to say what the problem is with what you've given. These functions work fine for probably thousands of others, so the first thing I would check is whether your lists are set up properly.

M.
Jul 22, 2015 at 10:48 PM
Sorry, I am new to all of this. My columns in the source list are just text values. I have included my script, I can put the data onto the form just fine it just provides me the error when I try to save the form.

$(document).ready(function() {

/State/
$().SPServices.SPFilterDropdown({
relationshipWebURL: "",
relationshipList: "{E39B82C6-FA69-4765-95A2-055EDBAE34A6}",
relationshipListColumn: "State",
relationshipListSortAscending: true, // Added in 2013.01
relationshipListSortColumn: "",
columnName: "State",
listName: $().SPServices.SPListNameFromUrl(),
promptText: "Select State...",
noneText: "(None)",
CAMLQuery: "<Eq><FieldRef Name='UniqueQuery'/><Value Type='Integer'>1</Value></Eq>",
CAMLQueryOptions: "<QueryOptions></QueryOptions>",
completefunc: null,
debug: false
});

/City/
$().SPServices.SPFilterDropdown({
relationshipWebURL: "",
relationshipList: "{E39B82C6-FA69-4765-95A2-055EDBAE34A6}",
relationshipListColumn: "City",
relationshipListSortAscending: true, // Added in 2013.01
relationshipListSortColumn: "",
columnName: "City",
listName: $().SPServices.SPListNameFromUrl(),
promptText: "Select City...",
noneText: "(None)",
CAMLQuery: "",
CAMLQueryOptions: "<QueryOptions></QueryOptions>",
completefunc: null,
debug: false
});


/ZIP/
$().SPServices.SPFilterDropdown({
relationshipWebURL: "",
relationshipList: "{E39B82C6-FA69-4765-95A2-055EDBAE34A6}",
relationshipListColumn: "Zip",
relationshipListSortAscending: true, // Added in 2013.01
relationshipListSortColumn: "",
columnName: "Zip",
listName: $().SPServices.SPListNameFromUrl(),
promptText: "Select Zip...",
noneText: "(None)",
CAMLQuery: "",
CAMLQueryOptions: "<QueryOptions></QueryOptions>",
completefunc: null,
debug: false
});
});
Coordinator
Jul 22, 2015 at 11:20 PM
You should only provide the options you actually need.
$().SPServices.SPFilterDropdown({ 
  relationshipList: "{E39B82C6-FA69-4765-95A2-055EDBAE34A6}",  // Note you can use the actual name of the list, e.g., "States"
  relationshipListColumn: "State", 
  columnName: "State",
  debug: true
}); 
Try just that and see if it works (always start simple).

M.