I have a single input question of type Color.
The default for this is Black (when not set explicitly).
When I answer this form and choose not to change the default answer and then submit, the answer JSON does not even contain this question or its default answer (which is black). Why? Is this a bug?
Why does Answer JSON not contain default color hex?
Answers approved by surveyjs Support
Hello,
Here is the working example. Please fork and then modify it to reproduce the issue.
Thank you,
Andrew
SurveyJS Team
Please see the forked illustration here. The Answer JSON does not contain Color question - https://plnkr.co/edit/ZTjKjdKeohdfop5K
In the plunkr you sent, there is just the color question and when I complete the survey, the Color question is saved in the answer JSON.
Hello Archana,
I tried your example. If you open the color picker and set the black color or set the "defaultValue": "#00000"
then the black color value will be in the log.
If you do not set the default value and do not choose a color then the value will not be in the log.
It is the correct behavior.
The problem, that html element should show a color by default when the value is undefined. Here is the html example. If you need to be sure that the color is set, then you can make your question required.
Thank you,
Andrew
SurveyJS Team