When looking in the documentation, it seems window has almost every integration besides ‘form’. docs.dhtmlx.com/windows__attaching_dhtmlx.html
↳ When looking here it has no guide on how to attach a form to the window. Is this not possible?
① Here is my form code below, could anyone tell me what code I need to strip?
② After stripping am I supposed to link it in the following line?→ myForm.loadStruct("…/common/form.json");
init new form instance, this is when you call var form = new dhtmlxForm() or var form = someComponent.attachForm()
load form struct. here you can load stuct from client side right after form init or you can generate struct on server side and load via inner form ajax, i.e. form.loadStruct("/path/to/php/script/here") which will return json struct
also ai recommend use inner dhtmlx function to perform default tasks, i.e.
$(‘input[name=id_task]’).val(’’); -> myForm.setItemValue(“id_task”, “”);
Dear Andrei, I was able to get it to work, but originally I used php code in my form to get certain fields. I think you are advising me to use JS/jQuery to fill in some fields instead.
And I’ll put the form on top of a grid in the future with an “open form” button somewhere, how would I fill in the ID in a certain field in the form?
You told me:
load both struct and values from cilent (if your struct and values are static)
load both from server (i.e. generated by php)
load struct (no matter from client or server) and then load values (from client or server also no matter)
so first you have to init form on client
var myForm = new dhtmxlForm(...);
then load struct (also you able to do it on init stage)
myForm.loadStruct([{type: “input”,… }]);
then load values with php (for this you have to give json- or xml-formatted data to form, which can be generated with php without needs to insert <? echo $_GET['id']; ?> into html file and mixing content)