Is it possible to set a default value on the itemValue
"Color" property based to the value of the question
"NewItemsColor" property when adding new choices?
Setting a default value for custom ItemValue property based on custom question property
Show previous comments
(0)
Comments
(0)
Sign in to comment on this post
Answers approved by surveyjs Support
Hello Giorgio,
To copy a question's color
property value to a newly added choice's color
property, implement the creator.onItemValueAdded
event and copy the question's property value to a corresponding property of a newly added choice item.
JavaScriptcreator.onItemValueAdded.add((sender, options) => {
if(!!options.obj.NewItemsColor){
options.newItem.Color = options.obj.NewItemsColor;
}
});
And before I let you go…If you have free time, I would appreciate it if you could leave a short review on SurveyJS page at Capterra. As we’re building our business, every review helps build credibility for future customers and your feedback would be greatly appreciated.
Thank you in advance!
Comments
(2)