joseM
March 30, 2016, 8:53pm
#1
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
Andrei
April 5, 2016, 10:25am
#2
Hi
please try the following:
edtnetForm.load({data: {name: "model", value: "XXX"}});
joseM
April 7, 2016, 8:41pm
#3
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
Andrei
April 8, 2016, 8:41am
#4
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.
Andrei
May 25, 2016, 2:41pm
#6
Email for demos posted above.
hgtdb
June 22, 2016, 7:19am
#7
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
Andrei
June 22, 2016, 12:46pm
#8
Hi
load() is for struct, setFormData() - for data
docs.dhtmlx.com/api__dhtmlxform_setformdata.html
istdb
June 22, 2016, 2:02pm
#9
странно…
вот этот код
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 в коде нет…
Andrei
June 27, 2016, 12:20pm
#10
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