My column Jurisdiction is a multichoice column. My program is as below :
for (var index = 0; index < ArrayRetrieved.Jurisdiction.results.length; index++)
$('#jurisdiction option[value="' + ArrayRetrieved.Jurisdiction.results[index] + '"]').prop('selected', true)
$("#jurisdiction").trigger("chosen:updated");
I get this error : Uncaught TypeError: Cannot read property 'results' of null. how i can resolve this please?
if(ArrayRetrieved.Jurisdiction){ for (var index = 0; index < ArrayRetrieved.Jurisdiction.results.length; index++) $('#jurisdiction option[value="' + ArrayRetrieved.Jurisdiction.results[index] + '"]').prop('selected', true) $("#jurisdiction").trigger("chosen:updated"); }