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.