surveyjs / survey-library

Free JavaScript form builder library with integration for React, Angular, Vue, jQuery, and Knockout.
https://surveyjs.io/form-library
MIT License
4.2k stars 809 forks source link

Add custom id to rating type in survey JS #2972

Open kamo4598 opened 3 years ago

kamo4598 commented 3 years ago

Are you requesting a feature, reporting a bug or asking a question?

Question

What is the current behavior?

Currently, random id is assigned to the rating option e.g. id="sq_102i". It gets changed almost every time the survey is opened.

What is the expected behavior?

Can we somehow assign a specified id to the rating options, so that I can dynamically manipulate the style of the options. Background: Instead of number 1-5, I want to render those options as emojis and add validations to the question text fields.

How would you reproduce the current behavior (if this is a bug)?

Provide the test code and the tested page URL (if applicable)

Tested page URL:

Test code

your_code_here

Specify your

andrewtelnov commented 3 years ago

@kamo4598 It is auto generated unique id. You can set your own id, just make sure it is unique.

Thank you, Andrew