ditdot-dev / vue-flow-form

Create conversational conditional-logic forms with Vue.js.

Home Page:https://www.ditdot.hr/en/vue-flow-form

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: Callback to get another question from the server based on an answer

mrivasa opened this issue · comments

Describe the solution you'd like
I would like to have an option to send an ajax callback to the server with the answer to a question to get the next question based on the selected answer.

Additional context
I cannot use the jump alternative because the options for the next questions depend on what the user selects on the previous question. Ex. Question 1 - What is the car's make? --- go grab all the models for the selected make and display them as options of the next question. 2 - What's the model? .... etc.

@mrivasa,

if only the answers are dynamic, you could do this by defining your questions as components and making your :options parameter point to a data variable which you could populate in your answer event callback. Fully making questions dynamic and fetching all the parameters of the next question from the server could currently be problematic (or even impossible) because of how VFF determines if you've fully completed the survey.