Setting default value for Dynamically added fields in Editor form
Setting default value for Dynamically added fields in Editor form
kaustubh.agrawal2000
Posts: 88Questions: 39Answers: 2
Hi
I am trying to add some fields dynamically to the editor form and it works correctly for new entries like below
editor.add({
'label' : ctf.field_name,
'name' : name
});
But when I try and add / update value for the same field like below
editor.field(name).update(ctf.field_value);
I am getting error like
common.js:260 Uncaught TypeError: editor.field(...).update is not a function
BTW, my field name is "ctf.2" if that is the problem.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
There is no
update()
method for a plaintext
field. The three build in field types which do have an update method areselect
,checkbox
andradio
.If you want to set the value for the field, use
field().val()
.Allan
Thanks Allan... Got it.. will try that out..