Can not save the new one record use dhtnlxForm

hi,

I use the dhtmlxForm to load and save the new record, I can load the record into dhtmlxForm, but it can’t save the record in database. Therefore I find 2 problem I can’t solve.

Question 1 :
I use the connector to control the data, but the dhtmlxdataprocessor.js has different size. I should use that one .

dhtmlxDataProcessor\codebase\dhtmlxdataprocessor.js (9kb)

dhtmlxForm\samples\06_data\php\connector\dhtmlxdataprocessor.js (17kb)

Question 2 :
If the dhtmlxdataprocessor.js can choose correctly. I just copy the code in “dhtmlxForm\samples\06_data” and change the label, name. Where the problem in the code.

test.htm

[code]function al_add_wins(){
var winForm,formData;
formData = [{
type: “settings”,
position: “label-left”,
labelWidth: 120,
inputWidth: 120
},{
type: “input”,
label: “Name”,
name: “applicant”,
value: “”
}, {
type: “calendar”,
dateFormat: “%Y-%m-%d”,
name: “al_date_from”,
label: “Date From”,
readonly: true,
value: “”,
enableTime: true,
calendarPosition: “right”
}, {
type: “calendar”,
dateFormat: “%Y-%m-%d”,
name: “al_date_to”,
label: “Date To”,
readonly: true,
value: “”,
enableTime: true,
calendarPosition: “right”
}, {
type: “select”,
name: “al_time_from”,
label: “Time From”,
value: “”,
options: [{
value: “1”,
text: “9:00 a.m”
}, {
value: “2”,
text: “12:45 p.m”
}, {
value: “3”,
text: “1:45 p.m”
}, {
value: “4”,
text: “6:45 p.m”
}]
}, {
type: “select”,
name: “al_time_to”,
label: “Time To”,
value: “”,
options: [{
value: “1”,
text: “9:00 a.m”
}, {
value: “2”,
text: “12:45 p.m”
}, {
value: “3”,
text: “1:45 p.m”
}, {
value: “4”,
text: “6:45 p.m”
}]
}, {
type: “checkbox”,
label: “Full Day”
},{
type: “button”,
value: “Load set 1”,
name: “set1”
},{
type: “label”,
list: [{
type: “button”,
value: “SEND”,
name: “SEND”
}]
}];

dhxWins = new dhtmlXWindows();
dhxWins.enableAutoViewport(false);
dhxWins.attachViewportTo("parentId");
dhxWins.setImagePath("dht/xWindows/codebase/imgs/");
w1 = dhxWins.createWindow("w1", 200, 30, 400, 350);
w1.setText("AL Application Form");
winForm = w1.attachForm(formData);
winForm.attachEvent("onButtonClick", function(id) {
    if (id == "set1"){
    	winForm.load("al_connector.php?id=1");
    }
    if (id == "SEND"){
    	winForm.save();
    	dhxWins.window("w1").close();
	}
});
var dp = new dataProcessor("al_connector.php");
dp.init(winForm);

}[/code]

al_connector.php :

[code]<?php
require_once(“lib/form_config.php”);
require_once(“dht/connector/codebase/form_connector.php”);

// sleep(1);

$form = new FormConnector($conn);
//$form->enable_log("log.txt");
$form->render_table("annualleave","alid","applicant,al_date_from,al_date_to,al_time_from,al_time_to");

?>[/code]

Could you give me any suggestion.
Thank you.

Kenneth

I solved the problem. thank you.