cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

CORS error when saving a form containing dropdown list modified via jQuery

Jump to solution

When trying to submit a form containing a dropdown list populated via jQuery, i get the following error:

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 pos...

I tried enabling CORS in my Web API application, but it didn't seem to make a difference.

Do you have any idea how I can set the enableEventValidation to False in the Nintex form templates?

Reply
4 Replies
Workflow Hero

Re: CORS error when saving a form containing dropdown list modified via jQuery

Jump to solution

here is a topic that recently dealt with the similar/same(?) problem NCAA bracket in Nintex Form

I haven't followed it since it was quite long and a bit out of my interest, I just remember it was being discussed and at the end some resolution was presented

Reply
Workflow Hero

Re: CORS error when saving a form containing dropdown list modified via jQuery

Jump to solution

Hey Marian,

Thanks for your reply, I managed to solve this yesterday by attaching a function to the save (and submit) buttons that disabled the custom dropdown lists, so no exception was generated when submitting the form.

Reply
Workflow Hero

Re: CORS error when saving a form containing dropdown list modified via jQuery

Jump to solution

Themos K‌, Can you post your code to show how it prevented the error?




SharePoint 2013 On-Prem | Nintex Forms & Workflow Enterprise
0 Kudos
Reply
Workflow Hero

Re: CORS error when saving a form containing dropdown list modified via jQuery

Jump to solution

Hey Chad Davis‌,

It's been over 2 years but I managed to dig up some of my old code, hope it might be of help!

PS: We've since migrated away from Nintex to using Aurelia.js, only about a million times more powerful and clear code

// DISABLE all lists in array
function DisableAllLists(ddlNames) {
   NWF$.each(ddlNames, function (index, value) {
      value.prop("disabled", "true");
   });
}

// DEFINE ALL dropdownlist objects
var PayrollPeriodList = NWF$('#' + ddlPayrollPeriod);

// ADD all list definitions to array, separated by commas
var DDLNames = [PayrollPeriodList];

// HANDLE document submition
NWF$(document).submit(function () {

   if (NWF$('.nf-validation-summary').css('display') == 'none') {
      DisableAllLists(DDLNames);
   }
});

Reply