DataProcessor

i have a form and dataprocessor object initialized.

what i want is to send the data to the server but not using any libraries like connectior.

i need some example about the xml format that is going to be returned from the server when i finish doing the jobs with the data beeing send by the dataprocessor.

here is my form and the rest of the code.

var formData =
[
{type: “input”, name: “userName”, value:"", label:“Потребителско име”,validate: “NotEmpty”},
{type: “password”, name: “password”, value: “”, label: “Парола”,validate: “NotEmpty”},
{type: “input”, name: “paidToDate”, value: “”, label :“Платено до дата”,validate: “ValidDate”},
{type: “label”, label: “Изберете статус на акаунта:”},
{type: “radio”, name: “userStatus”, value: “1”, label :“активен”, checked: true},
{type: “radio”, name: “userStatus”, value: “0”, label: “замразен”},
{type: “hidden”, name: “firmName”, value:""},
{type: “button”, name: “btn2”, value: “Регистрирай в системата”, style: “text-align:center”, command:“validate”}
];

            form = new dhtmlXForm("addAccountForm", formData);
            
            var dp = new dataProcessor("/ServerTitle/AccountsServlet?type=register_account");
            dp.setTransactionMode("POST", true);
            dp.init(form);
            dp.defineAction("insert", function(node){alert("Gotovo ");});
            dp.defineAction("sqlError", function(node){alert("Възникна грешка при опит за свързване към базата данни");});
            dp.attachEvent("onAfterUpdateFinish",function(){
                //alert("Регистрирането на акаунта беше успешно");
            });

            form.attachEvent("onButtonClick", function(name, command){});
            form.attachEvent("onValidateSuccess", function (input, value, result){});
            form.attachEvent("onValidateError", function (input, value, result){});
            form.attachEvent("onAfterValidate", function (id, result)
            {
                if(result == true)
                {
                    this.save();
                }
                else alert("Имате грешно попълнени данни!");
            });

the problem is that the dataprocessor send the data to the server but when i try to send again another data nothing happens which makes me think that i dont give it the right xml response.

pls help.

Hello,

here is the documentation about dataprocessor and server responces:

docs.dhtmlx.com/doku.php?id=dhtm … sks_errors

In case of “inserted” operation, the response is:

“updated”

<action type=‘updated’ sid=‘item_id_here’ tid=’‘item_id_here’ >

i know that. I wanted to point out that i am using dataProcessor with form and when i send the data to the server it accepts it and i have no problem to send some response back to the client. But the next time i try to use the form without refreshing the page to send another data to the server it does NOTHING.

any idea?

The problem may be in caching on the client side, especially if you use IE.

But the next time i try to use the form without refreshing the page to send another data to the server it does NOTHING.

Make sure that connector.js is included after dataprocessor: