SpServices ( ) Windows.setTimeout() reducing my form speed

Feb 4, 2014 at 12:32 PM
this is my code for InfoPath postback

window.onload = function() {
window.setTimeout(getData, 1000);
}

function getData(){
getReq();
window.setTimeout(getData, 1000); //To handle IP's form postback
}

function getReq(){
var requirement = [];
$().SPServices({
operation: "GetListItems",
listName: "requirement",
CAMLViewFields: "",
CAMLQuery:"<Query><Where><And><Eq><FieldRef Name='Inactive0'/><Value Type='Boolean'>0</Value></Eq><Eq><FieldRef Name='Status'/><Value Type='Text'>Open</Value></Eq></And></Where></Query>",
async: false,
completefunc: function (xData, Status) {
$(xData.responseXML).SPFilterNode("z:row").each(function() {
requirement.push({label:$(this).attr("ows_Title"),value:$(this).attr("ows_ID")});
});
}
});

$("input[id$='FormControl0_V1_I1_T1']").autocomplete({
source: requirement,
minLength: 2,
change: function (event, ui) {
                 },
select: function( event, ui) {
alert(ui.item ? ("You picked '" + ui.item.label + "' with an ID of " + ui.item.value) : "Nothing selected, input was " + this.value);
$("input[id$='FormControl0_V1_I1_T2']").focus();
$("input[id$='FormControl0_V1_I1_T1']").val(ui.item.label);
$("input[id$='FormControl0_V1_I1_T2']").val(ui.item.value);
event.preventDefault();
strEmployee = ui.item.value;
return false;
},
focus: function(event, ui){
event.preventDefault();
$("input[id$='FormControl0_V1_I1_T1']").val(ui.item.label);
      return false;
    }
});
}
in the function getEmployee() and getCompany() i am using autocomplete for the textbxox, for the code windows.setTimeout(getData, 1000), my form gets very slower for every 1 sec it is getting postback , is there anyother solution for postback to make my form speed
Coordinator
Feb 10, 2014 at 5:23 PM
You have contacted the CodePlex Team.

It looks like your request would be better directed toward the specific project you are using.

I encourage you to use the discussion service or issue tracker for the project you are interested in.
Marked as answer by kedavid on 2/10/2014 at 10:23 AM