cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dynamically populate dropdown - Invalid postback or callback argument error on Submit

I am trying to populate a dropdownlist dynamically in a nintex form. The list will display all the list Titles in a site. I have a text box field to enter the url for the site and based on the url the dropdownlist will be populated. Adding the source code below.

 

 

The dropdownlist is populated based on the url. But when I select the list title and submit the form it is throwing Invalid postback or callback argument error.

 

NWF$(document).ready(function(){

 

NWF$('#'+Title).change(function() {valueChanged()} );

 

 

function valueChanged() {  

 

  var url= NWF$('#'+Title).val();

    $.ajax({

        url: url+"/_api/lists",

        type: "GET",

        headers: {

            "accept": "application/json;odata=verbose",

        },

        success: function (data) {

for(var i=0;i<data.d.results.length;i++)

{

var text=data.d.results.Title;var val=data.d.results.Title;NWF$('#'+ShrptList).append( new Option(text,val) );}

} ,

        error: function (error) {

            alert(JSON.stringify(error));

        }    });

 

}  

});

 

 

I checked the thread The specified item was not found.  and as mentioned in the solution I tried loading the dropdown on page load itself.

as shown below ( added the script to load dropdownlist directly to the custom javascript option in form settings) and still it is throwing the same error. Please confirm whether I am doing this correctly.

 

 

var url= "url of site";

    $.ajax({        url: url+"/_api/lists",        type: "GET",        headers: {            "accept": "application/json;odata=verbose",        },        success: function (data) {for(var i=0;i<data.d.results.length;i++){ var text=data.d.results.Title;var val=data.d.results.Title;NWF$('#'+ShrptList).append( new Option(text,val) );}  } ,        error: function (error) {            alert(JSON.stringify(error));        }    });

 

 

 

Please help me with this error.

Labels: (2)
Tags (1)
0 Kudos
Reply
1 Reply
Workflow Hero

Re: Dynamically populate dropdown - Invalid postback or callback argument error on Submit

I think that you can find a solution in this post :

Filtering Dropdown using JQuery

0 Kudos
Accept as Solution Reply