Question T9641
Visible to All Users

How to change label name field

created 3 years ago

Hello
How to change this defined id for choice ("Вариант1" in Russian, and "item1" in English)
I'd need to make it only digits

Instead of:
Вариант1 -> 1
Вариант2 -> 2
Вариант3 -> 3

Clipboard-File-1.png

Answers approved by surveyjs Support

created 3 years ago

Hello,
For the latest version (1.9.33). It is as easy as the following:

JavaScript
const choices = [ "My choice1""My choice 2""My choice3"]; const defJSON = SurveyCreator.settings.toolbox.defaultJSON; defJSON.radiogroup = { choices: choices }; defJSON.checkbox = { choices: choices }; defJSON.dropdown = { choices: choices };

Here is the working example.

Thank you,
Andrew
SurveyJS Team

    Comments (2)

      but how to make it like AI (auto increment => 1 -> 2 -> 3 -> 4…)?
      i can't use predefined variable array, because number of choices is unknown

        Hello,
        What do you mean?
        It is an initial predefined value. After that SurveyJS Creator is smart enough to find a pattern and add a correct digit. Please, just try the latest version.

        Thank you,
        Andrew
        SurveyJS Team