I can’t seem to get this dhtmlxForm to work. I am using my own form. I don’t get any errors anywhere - the form simply does not load any data from my database. I have successfully integrated a grid with no issues. What am I missing here?
Here is my contact_details_connector.php file:
<?php
require_once('form_connector.php');
$res=mysql_connect("localhost","root","");
mysql_select_db("xxxxxxxxx");
$form = new FormConnector($res);
$form->render_table("contact_details","id","name");
?>
Here is my form with my binding and form connectors. The 26 is the id of my record.
Name:
var myForm = new dhtmlXForm("contact_details_form","contact_details_connector.php");
myForm.load(26);
Initialization code looks correct
Try to load
contact_details_connector.php?id=26
in separate window, and check that it outputs valid XML , without PHP errors.
It seems the myForm.load(26) pointing to the js file is not working. Somehow the xml file is not getting recognized even though the connector works when I run it by itself (as seen above).
XML data need to be sent with
Content-type:text/xml
In other case, it will not be processed correctly by client side scripts ( connectors assign such headers by default )
If you are using connectors - you need not add anything, all headers must be sent automatically.
If you are providing xml data from any other source ( custom scripts, static files, etc. ) - you need to be sure that server will send data with correct xml headers.
In case of custom scripts - in can be done by adding special commands ( “header” in case of php ), in case of static files - be sure that your server sends files with extension which you are using as text/xml ( it can be configured in server configuration, must be a default setting in case of .xml files )
Ok, I understand what you mean now. In this case, I am using your connector not a custom script. Look at my initial comments above and see the connector I am using.
In case of connector - be sure that you have not any extra output before connector’s code.
Any white-space or new-line, which was outputted before connector’s code may break xml output in FF.
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan