Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

neelraina
neelraina
5,587 Points

How can I create a dynamic multi-step form, where each step changes depending on the input from the previous step?

Hi Treehouse community!

I am creating a site with Laravel and need to make a form that changes depending on user input.

Specifically, step 1 will ask for the type of function (it's an event site for a music band) that the customer would like to hire. Depending on what the user chooses, the options in step 2 will be based on the option chosen in step 1, and so on.

I am really clueless on how to carry this out. I am setting my sights on Angular JS for this, but am not sure on how to do it/where to look for guidance. The best resource I stumbled on is this blog post: https://scotch.io/tutorials/angularjs-multi-step-form-using-ui-router, but it only talks about a multi-step form, and not how to make the steps interdependent and automatically/change depending on the user input in previous steps.

Oh, and if anyone out there knows how to use the necessary javascript/Angular JS in Laravel, that would be manna from heaven!

2 Answers

I just started learning Angular and believe it would be a good choice for your situation, never messed with Laravel but maybe check out this place and see if it helps. http://learninglaravel.net/topics/angularjs Good luck!

neelraina
neelraina
5,587 Points

Thanks for the reply Colton! I actually checked out the website yesterday, and will dig in more today. Cheers!

I have been using Laravel as well for the past 6 months or so. Love it! Check out this walkthrough... https://laracasts.com/series/learning-vuejs Not exactly what you are looking for but I believe there iis an example of what you are looking for on the vuejs site. Laracasts also has a series on React. I am exploring both and IMHO React would be the way to go if you are wanting to learn something long term for larger sites. Vue seems easier to learn for a small project and probably just JQuery if all you are worried about is your current project.

neelraina
neelraina
5,587 Points

Hi Bruce,

I actually ended up using Vue.js! It is so lightweight and convenient for my purposes. And the series on Laracasts is what convinced me to go in that direction. I always presumed (out of ignorance) that if you needed two-way binding then Angular was your only bet. React was tempting as well, but I don't think this application would really benefit from it - at least in it's current form Vue would suffice.