Question about mutiple select in editor

Question about mutiple select in editor

yu yen kanyu yen kan Posts: 65Questions: 31Answers: 0
edited March 2017 in Free community support

#Edited

I have a field declare like this

label: "object:",
name: "object.field_id",
multiple: true,
separator: ", ",
type: "select",
ipOpts: [ { label:"object 1", value:"1"}, { label:"object 2", value:"2"}   ]

since it is multiple select, by default the object is included object 1 and object 2, but when I press edit, it have no selected value. what should I do to make it selected when edit?

Replies

  • allanallan Posts: 63,471Questions: 1Answers: 10,467 Site admin

    The default should match the form of the data if you were to use field().val() to get the field's value.

    Because you are using a separator, that will be a string here. If you didn't use a separator, but did retain the multiple it would be an array.

    Allan

This discussion has been closed.