Saving a form creates a new record instead of updating

I have created a form that is bound to a database. The form loads properly. When I save the form, instead of updating the existing record, a new record is appended to the database.

I have tried several things:
-changing dhxForm.save() to dp.save()
-dropping the settransactionmode statement
-dropping the id parameter on the dataprocessor init
-switching between render_table and render_sql (with a built-in where clause)

I’m not sure what I’m missing. Any suggestions appreciated.

Here is index.html

[code]

[/code]

Here is form.xml

<?xml version="1.0"?>
<items>
	<item bind="fullname" type="input" name="fullname" value="" label="Full Name"/>
</items>

Here is data.php

<?php
	require_once("config.php");
	$res=mysql_connect(DB_HOST,DB_USER,DB_PASSWORD);
	mysql_select_db(DB_DATABASE);
	
	require_once("dhtmlxForm/codebase/connector/form_connector.php");
	$form = new FormConnector($res);
	$form->render_table("contacts","id","fullname");
?>

Any ideas? My simple demo form closely mirrors the documentation. I don’t see why this shouldn’t work.

Perhaps someone can point me in the direction of a working demo that:

  1. loads data from a database,
  2. loads form content from an .xml file, and
  3. allows updating of the record being displayed

Many thanks.

Try to use:

var dp = new dataProcessor("data.php);

Will behavior the same now?

As I mentioned above, the behavior is the same whether or not I apply the id parameter to the new dataprocessor. Let’s try this another way, can you point me to a demo application that can successfully load a form from a database and then update that same record? All samples seem to use grids or xml files.

I’m using this command bud:

myForm.send(“dataprocessor.php”,“post”,function(xml){
*** code to be executed after callback ***
});

then again i’m using the form 3.0 from DHTMLX which is still in beta mode i believe.

hope that helps,
Kisuk

can you point me to a demo application that can successfully load a form from a database and then update that same record?
You can find working examples at your dhtmlxForm package dhtmlxForm\samples\06_data\