Survey-library: SurveyJs Input element with addon

Created on 16 Jan 2021  路  3Comments  路  Source: surveyjs/survey-library

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

Feature, Question

What is the expected behavior?

Am using ReactJS with surveyjs, I want to use an input element for a percentage value (%). I wonder if there is a way of doing this:

  • Using bootsrap addon or something like that with surveyjs inputs.
  • Limit input value between 0 and 100.

Thank you.

question

All 3 comments

@AWIXOR Your json should be like this:

        {
            name: 'question1',
            type: 'text',
            inputType: 'number',
            title: 'Please enter value from 0 to 100:',
            min: 0,
            max: 100,
            step: 1,
            validators: [
                {
                    type: 'numeric',
                    minValue: 0,
                    maxValue: 100,
                    errorText: 'Your value is not in the range [0...100]',
                },
            ],
        },

Here is the example.

Thank you,
Andrew

Thank you, this worked for the second part of my question what about the first any ideas ?

@AWIXOR You can use survey.onAfterRenderQuestion event to update the html element. Here is the example.

Thank you,
Andrew

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wollerman picture wollerman  路  4Comments

halexiev-hedgeserv picture halexiev-hedgeserv  路  4Comments

madceb picture madceb  路  3Comments

misamura picture misamura  路  4Comments

Lordchapter picture Lordchapter  路  3Comments