You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to have a multi prompt similar in some ways to the form prompt but with a couple minor differences.
First, render the actual registered prompts for validation purposes. (which I don't think forms supports that but might be nice if it did too).
Second, the purpose of multi prompt is to re-ask the same questions over until the user indicates they are finished. This would be great for populating an array of objects.
E.g -
Contributors:
Full Name:
Email:
Website:
Would you like to add another (Y/n)?
The end result might look something like the following:
@macmichael01 I think both of your requests possible now.
Request 1 - Validating form choices
The Form prompt supports validation. If you aren't able to get it working, then please create a bug report so we can see what's causing problems for you and get it fixed. See this example.
In the choice objects, you can add a validate() function.
Request 2 - Re-asking the same questions
You should be able to accomplish this by simply wrapping your prompt in a function, and recursively calling the function if the user gives a truthy response. Let us know if you have trouble getting this to work. If I'm not understanding your request, then it might help to provide a more detailed example, possible a mockup of the screen so that I can visualize what you mean (I'm a visual learner, and I have a much harder time understanding verbally. Thanks in advance!)
It would be nice to have a multi prompt similar in some ways to the form prompt but with a couple minor differences.
First, render the actual registered prompts for validation purposes. (which I don't think forms supports that but might be nice if it did too).
Second, the purpose of multi prompt is to re-ask the same questions over until the user indicates they are finished. This would be great for populating an array of objects.
E.g -
Contributors:
Would you like to add another (Y/n)?
The end result might look something like the following:
The text was updated successfully, but these errors were encountered: