Can't get save() to work in a form

Hi,

I created a Form and attached it to a Layout.

I connected it with a mysql database and the data is loaded. When I change the the content of a field and click on the save button no changes are saved. In fact I have the impression that notting happens beacuse also the validation rules are not working which should be performed before the save(). What am I doing wrong?

Thx for your support!

Dave

My Code:

In the header

In the body

Layout

Form layout

Linking the form to the layout and loading data

form_connector.php

$mysql_server=“localhost”;
$mysql_user = “root”;
$mysql_pass = “”;
$mysql_db = “mnc2”;

$conn=mysql_connect($mysql_server,$mysql_user,$mysql_pass);
mysql_select_db($mysql_db);

require_once(‘codebase/form_connector.php’);

$form = new FormConnector($conn);
$form->render_table(“mc_boer”,“boer_id”,“boer_id,boer_naam,boer_omschrijving”);

Hi,

myForm.save() calls the save method, and myForm.save doesn’t.

Here is the corrected code snippet:

myForm.attachEvent(“onButtonClick”,function(buttonID){
if(buttonID==“btn”){
myForm.save();
}
})

Hi,

Thx for your reply.

I copied your code in my file but still it is not working. When I click the button nothing happens. I placed an alert after the “myForm.save();” and that is showing.

What else could be wrong?

Thx for your support!

Regards,

Dave

Hi,

There is one more problem with your code - init method of DataProcessor takes form object. So, you should call
dp.init(myForm);
instead of
dp.init(formStructure);

Please have a look at the sample:

dhtmlxForm/samples/06_data/03_save.html