Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

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:
[
new QuestionModel({
title: 'Question',
type: QuestionType.MultipleChoice,
options: [
new ChoiceOption({
label: 'Answer'
})
]
})
]

You must be logged in to vote

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.

Replies: 4 comments

Comment options

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

You must be logged in to vote
0 replies
Comment options

Yes, exactly - I want to pre-define 2 different forms, let's say a survey form and a quiz. When a user lands on
www.example.com/survey <- load flow-form with questions for survey via api call
www.example.com/quiz load questions with quiz via api call

Ideally, I i'd like users to create their own form as well. Any pointers for that usecase?

Thank you so much already :)

You must be logged in to vote
0 replies
Comment options

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.

You must be logged in to vote
0 replies
Answer selected by jbdw85
Comment options

Thank you for the explanations!

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.