I am having an issue using the send method of dhtmlxForms. It appears that every time I use this method, it posts the data to the server twice.
myForm3.attachEvent("onButtonClick",function(id){
if(id=="send_button"){
var sData = myForm3.getFormData();
alert(sData);
myForm3.send("http://192.168.1.20/cgiGroupJSON.exe?function=PlanYear_Discrim_Screen_form_set&ID=" + glPYRID, "get", function(loader, response){
alert(response);
});
}
});
That is one sample snippet where this occurs. Note the “alert(response)” line. That only gets displayed once. I also tried putting an alert at the very top of the routine and that alert only occurred once, so it appears that for some reason the send method sends the data twice.
Does anyone know why this would happen and if it can be stopped? On an update it is just inefficient, but if the data in the form is being added it creates two records. I have tried it in both “post” and “get” mode and it is called twice in both.
I searched through the dhtmlx.com site and I found an instance of the “onClick” event being added twice and called for each one, but none of the alerts are showing more than once.