Closed michaelchandrag closed 5 years ago
You need to use the following code:
survey.data = {
"car": "other",
"car-Comment": 'My Other Car'
};
Here is your updated plunker - https://plnkr.co/edit/frYgVmDXwWMFSy91OUy0?p=preview
hey thanks for the answer @tsv2013 it worked perfectly additional question not related to the title thread can i change the style of requiredText (*) to color red? i found this thread, but it is using another libraries https://github.com/surveyjs/survey-library/issues/539
can i achieve that without using third-party library?
nvm i solve my requiredText problem this is how i do it
model.onTextMarkdown.add(function (survey, options) {
if (options.element.isRequired === true) {
options.html = options.text
}
})
dont forget to add requiredText add your json survey
requiredText: '<span style="color:red;">*</span>',
Are you requesting a feature, reporting a bug or asking a question?
Asking a question
What is the current behavior?
I have a survey with a dropdown question and it has attribute
hasOther: true
. On the other hand, i also have a data which i would set it to the answer of the survey. The data could be like thisThe question more like this
The current dropdown question doesnt have 'My Other Car' options. Can the surveyjs achieve this? By automatically, showing other values and the answer at the 'other' input text if there are no matching option on dropdown with the value data
What is the expected behavior?
Showing 'other' values at the dropdown and the'other' input text is by default showing the data value
How would you reproduce the current behavior (if this is a bug)?
Give 2 question 1 for dropdown 1 for answer of the other
Provide the test code and the tested page URL (if applicable)
Tested page URL: https://plnkr.co/edit/YMKDnpcndF0pg5K4PmoM?p=preview Test code
Specify your