Closed Robby123456 closed 3 years ago
Reporting a bug
Validation errors are not being displayed for questions inside dynamic panels
A validation message is displayed and survey should not complete
In the Plunker example:
Tested page URL: https://plnkr.co/edit/Dh5xS496blwDDIp9
Test code
//assign call to onServerValidateQuestions callback function surveyValidateQuestion(survey, options) { var name1 = options.data["panel1"][0].name1; var name2 = options.data["name2"]; if (!name1) { options.errors["name1"] = "Please enter a value"; options.errors["panel.name1"] = "Please enter a value"; options.errors["panel1[0].name1"] = "Please enter a value"; } if (!name2) { options.errors["name2"] = "Please enter a value"; } options.complete(); } Survey .StylesManager .applyTheme("modern"); var json = { questions: [ { "type": "paneldynamic", "name": "panel1", "title": "Name List", "templateElements": [ { "type": "text", "name": "name1" } ] }, { "type": "text", "name": "name2" } ] }; window.survey = new Survey.Model(json); survey .onComplete .add(function (result) { document .querySelector('#surveyResult') .textContent = "Result JSON:\n" + JSON.stringify(result.data, null, 3); }); survey .onServerValidateQuestions .add(surveyValidateQuestion); $("#surveyElement").Survey({model: survey});
We missed this question. Here is the updated example.
Thank you, Andrew
Are you requesting a feature, reporting a bug or asking a question?
Reporting a bug
What is the current behavior?
Validation errors are not being displayed for questions inside dynamic panels
What is the expected behavior?
A validation message is displayed and survey should not complete
How would you reproduce the current behavior (if this is a bug)?
In the Plunker example:
Provide the test code and the tested page URL (if applicable)
Tested page URL: https://plnkr.co/edit/Dh5xS496blwDDIp9
Test code
Specify your