Form Json load

Hi
I’m using Dhtmlx 4.6 Pro and i’m trying to set input field value in a form using form.load feature
using json.
I have created this simple form:

Dataform = [ {type:“input”,name:“model”,value:""}];
edtnetForm = wform.attachForm(Dataform,true);

Form in it’s window opens ok, then i try to load data to fill up input field using your example:
// local json/xml object
edtnetForm.load({data:[{id:“model”,value:“XXX”}]});

i also tried:
edtnetForm.load({data:[{name:“model”,value:“XXX”}]});

but input field “model” never gets and shows the value “XXX”.

I don’t know what i’m doing wrong, i appreciate any help

Thanks in advance,

JoseM

Hi

please try the following:

edtnetForm.load({data: {name: "model", value: "XXX"}});

Hi Andrei

Thank you for your reply.
I already try it and does not work, same result, nothing appears in the “model” input field.

Regards

joseM

Then please provide us complete demo including all correspondnig js/css files?
Please also add information regarding current and expected behaviour.

Here is a small guide how to make a complete demo:
docs.dhtmlx.com/tutorials__auxil … pport.html

If you don’t want to share your demo here for any reasons - you can send it to support@dhtmlx.com, if so - please include link to this forum topic.

If you’re using PRO Edition please send your demo to support@dhtmlx.com

I am facing exactly the same issue.

Email for demos posted above.

is ther any solutoion for the problem to load data into form via json

this syntax not work:
myForm.load({data: {name: “ATelefon”, value: “XXX”}});

but if I use the same as an xml file, I get the value “XXX” into the field ATelefon

it seems so, that json will not work

thanks

Hi

load() is for struct, setFormData() - for data
docs.dhtmlx.com/api__dhtmlxform_setformdata.html

странно…
вот этот код

console.log(">>> Form ",id);
var values = myForm.getFormData();
console.log(“values”,values);
myForm.load(“ggschein.prg?act=getRecord&id=35219”);

загружает нужную запись (id=35219) в форму
правда загружается почему-то только запись в форме XML

35219 .... ... ...

вот что в отладчике FF

[b]>>> onButtonClick Load

Form Load
values Object { VersandNr: “”, VersandNr2: “”, C_Land: 0, C_See: 0, C_Luft: 0, Bestim_Ort: “”, GesAnz: “”, GebArt: “”, InhGeb: “”, Abteilung: “”, 9 weitere… }[/b]

при этом никаких setFormData в коде нет…

Hi

Could you please provide us complete demo including all correspondnig js/css files?
Please also add information regarding current and expected behaviour.

Here is a small guide how to make a complete demo:
docs.dhtmlx.com/tutorials__auxil … pport.html

If you don’t want to share your demo here for any reasons - you can send it to support@dhtmlx.com, if so - please include link to this forum topic.

If you’re using PRO Edition please send your demo to support@dhtmlx.com

Hi … i am also facing the same issue… my input box does display set value.
and in my form checkbox is not working properly, On Click checkbox is not getting checked.

Works for me.
docs.dhtmlx.com/snippet/1803ff5ef

If problem still occurs, please share any kind of a sample