There are three variants to deal with form data using dhtmlxForm:
All these ways can be initialized through event handlers of dhtmlxForm associated with various elements and onButtonClick event, associated with 'button' element in particular.
send data on proc.php when user clicks button with name //my_submit_button// myform.attachEvent("onButtonClick", function(name, command){ if(name=="my_submit_button"){ this.send("proc.php"); } });
You also can use button commands which can be specified in the command attribute of a 'button' element for some common actions. They are:
In case you've based a dhtmlxForm object on the existing html form you can deal with the form like with any HTML one:
If you initialize dhtmlxForm from configuration structure, you still can add <form> tag around the container and use the same two ways to submit data to server.
DhtmlxForm provides the ability to send its data to server using AJAX request (GET or POST) and then process reply with send() method.
dhxForm.send("some.php"); //or dhxForm.send("some.php","post"); //or dhxForm.send("some.php","post",function(xml){ alert("Saved"); });