Question T14120
Visible to All Users

Required value validation doesn't raise immediately with error mode "onValueChanged"

created 2 years ago

Hi team,

We are having issues in implementing Validation of SurveyJS which we set in Designer.
We have set the Validation property as "OnValueChanged (After an Answer is Changed)" in Designer. But the same validation is not reflecting for properties which are set "IsRequired".

We have shared the sample application, please refer that.

Thanks,
Santosh

Show previous comments (9)

    Hello Santosh,
    We will show the required error if a user makes a required field empty and before it was not empty. We do not show an error if the value was set into survey.data or complex questions like matrix dynamic or panel dynamic.

    Thank you,
    Andrew
    SurveyJS Team

      As per your comment "We will show the required error if a user makes a required field empty and before it was not empty", I tried to set the value to textbox type of question which is required then erased the value but it did not thrown the error.

      Thanks,
      Santosh

        Hi Santosh,
        Please ensure that you updated your SurveyJS libraries 10 the most recent version (v1.9.103).

        package.json

        JSON
        "survey-angular-ui": "1.9.103", "survey-core": "1.9.103"

        Also, please verify that the survey.checkErrorsMode property is set to "onValueChanged".

        JSON
        { checkErrorsMode: "onValueChanged", pages: [ { name: "Name", elements: [ { type: "text", name: "FirstName", title: "Enter your first name:", isRequired: true, defaultValue: "Jane" } ] } ] }

        I created the following demo for your reference and confirmed that it performs as expected: View Demo

        2023-08-16_9-35-42.gif

        We look forward to your results.