Problems using connector and processor with Dhtmlxform


I’ve spent most of today trying to get my form to load, and also to get the form to update the database. I’m sure there is something I’m doing wrong, but I’ve looked at the documentation and samples, and can’t figure it out.

Here is the form:


Constructed form

var dp;
var formData;
var myForm;
function doOnLoad() {
formData = [{
type: “input”,
name: “Title”,
label: “Title”,
value: “”,
width: “750”,
bind: “title”
}, {
type: “input”,
name: “Description”,
label: “Description”,
value: “”,
width: “750”,
bind: “code”
}, {
type: “input”,
name: “Justification”,
label: “Justification”,
value: “”,
width: “750”,
bind: “lvl”

		myForm = new dhtmlXForm("myForm",formData);
		dp = new dataProcessor("myFormConnector.php");
	    //data[0] - request object
	    alert(data[0].responseText); // - incorrect server side response
	function saveData() {;
<body onload="doOnLoad();">

	<div id="myForm"></div>
	<input type="button" value="Save data" command="save" onclick="javascript:saveData();">


Here is the PHP connector:


$serverName = "CH-SQL-6\Pentamation_rpt";

$connectionInfo = array( "UID"=>$uid, "PWD"=>$pwd, "Database"=>"COF_Objects_Dev", "LoginTimeout"=>15); // <- SS authentication
$res = sqlsrv_connect( $serverName, $connectionInfo); // <- SS authentication

    echo "Connection established.\n";
    echo "Connection could not be established.\n";
    die( print_r( sqlsrv_errors(), true));

$form = new FormConnector($res,"SQLSrv");
$form->render_sql("SELECT title, code, lvl FROM proj_title","code","title, code, lvl","");  

/* Close the connection. */
echo “Connection closed.\n”;

And here are my questions:

  1. Do I use the data connector to UPDATE the database table from the form, or can I use just the connector for both SELECT and UPDATE?

  2. Do I use one PHP connector file to SELECT and another one to UPDATE the database?

  3. How do I tell the form to load a specific record? I tried


where the record ID is ‘1008A695’, but it didn’t work; all fields are empty after form load.

  1. How do I tell the form to save changes? Clicking on the SAVE button produces a JavaScript error, ‘Object doesn’t support this method’ at

Thank you for your help.


you need this lines

<script src="../dhtmlxForm/codebase/dhtmlxdataprocessor.js"></script>
<script src="../dhtmlxForm/codebase/connector/connector.js"></script>

Thanks, sickeiros, but if you check my code samples, those two files were already in there.

Stanislav, are you there? Anyone at DHTMLX? Some answers would be really welcomed. I’ve just about ran out of time on my project trying to make the form work, and may have to drop your product and just write the app in PHP.


(1) you can use the same connector file for both operations

(2) can be organized in such way, but has not sense in most cases.

myForm.load(“myFormConnector.php?id=‘1008A695’”); //always id, without relation which field is real primary key

instead of

function saveData() {; }
you can use

function saveData() {; }

Спасибо, Станислав.

Unfortunately, my boss has indicated I’ve run out of time on this project trying to get the DHTMLX form control to work. I’m now writing the web app in PHP.

I will try our solutions after the app is finished. I also have an upcoming project for which I would like to use the DHTMLX grid control - it seems to be powerful and a more mature product than the form control.

Until then, thank you once more.