-
I really like this form generator but am stuck on how to save below-mentioned code to a server and then retrieve it so it can be used in the questions array? Hopefully you know an obvious way, I am still learning. Can you point me in the right direction on how to achieve this? Do I need to save title, type, options etc as a string? questions: |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Hi @jbdw85, if I understand correctly, you want construct your question list by grabbing it from an AJAX URL? To do this, you'd probably want to return an array from your back-end with all necessary properties and then pass in that array into Vue Flow Form's question prop. Take a look at how the questions are defined in the support page example to get a better idea: https://github.com/ditdot-dev/vue-flow-form/blob/master/examples/support-page/Example.vue#L80-L156 |
Beta Was this translation helpful? Give feedback.
-
Yes, exactly - I want to pre-define 2 different forms, let's say a survey form and a quiz. When a user lands on Ideally, I i'd like users to create their own form as well. Any pointers for that usecase? Thank you so much already :) |
Beta Was this translation helpful? Give feedback.
-
In this case you'd define an API endpoint in the backend of your choice which would return the question array based on what was requested, and then pass that to VFF. Enabling users to create their own forms would be possible as well, although is out of scope for Vue Flow Form itself. You'd have to create a web app where users could log in and construct their form based on Vue Flow Form's options (question type, question label, required true/false, etc.). And then again when displaying, grab the question array from your backend API and construct the form. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the explanations! |
Beta Was this translation helpful? Give feedback.
In this case you'd define an API endpoint in the backend of your choice which would return the question array based on what was requested, and then pass that to VFF.
Enabling users to create their own forms would be possible as well, although is out of scope for Vue Flow Form itself. You'd have to create a web app where users could log in and construct their form based on Vue Flow Form's options (question type, question label, required true/false, etc.). And then again when displaying, grab the question array from your backend API and construct the form.