Survey-library: On render pass data to pre-populate IF the field exists

Created on 23 Mar 2018  路  2Comments  路  Source: surveyjs/survey-library

I'm trying to onRender populate multiple fields but only if they exists. The data to pre-populate would be provided in the form or an array or object.

Ideally this is what would happens:

var data = [
     name: "bob",
     email: "[email protected]"
];

And on render it will fill the name field if it exists with the data's name, and the same for email. I'm trying to make this dynamic so I don't have to manually set each field since the data array would be dynamically generated.

question

All 2 comments

@Braunson You may prepare the mode in the code. Here is the example.

Thank you,
Andrew

Thanks @andrewtelnov I also made use of setting survey.data which will set pre-populate the data if the inputs exists with the same name.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GuiAfonso picture GuiAfonso  路  4Comments

ian-emsens-sb picture ian-emsens-sb  路  3Comments

AWIXOR picture AWIXOR  路  3Comments

xiuzhen1103 picture xiuzhen1103  路  4Comments

misamura picture misamura  路  4Comments