Sanity check. Dynamic form based on drop down input

Soldato
Joined
28 Sep 2008
Posts
14,158
Location
Britain
Hi all,

It's been some 11 years or so since I stepped properly near PHP/MySQL, JS, etc and see that things have moved on.

What I'm looking to achieve is an input form that the user selects an option in box 1, it then reduces the potential options for box 2 (based on box 1), and that reduces the potential options for box 3, based on box 2.

IE:

Box 1 user selects from Dog or Cat.
Based on that selection, (assuming Dog), Box 2 now only shows dog breeds (it's not a useable box until box 1 is chosen). And then, you guessed it, based on Box 2, Box 3 shows something else, only relative to box 2. This then all needs to get wrapped up into an array and put back into the DB on the submit button.

What I can't seem to find, is any new cool fancy BootStrapper 4.0 way of doing any of this, and most results still seem to pull back code from circa 5-10 years ago with anything meaningful. Surely things for this have moved on someway?

Is it best I still pull those options from a DB table?

Hopefully someone can give me a pointer.
 
Soldato
Joined
27 Dec 2005
Posts
17,296
Location
Bristol
I would just use Ajax and jQuery but I'm normally out of date with things like this!

If you need to pull the options from a database I'd use PHP etc else I'd just have them at options in the JS if they're not going to change.
 
Soldato
OP
Joined
28 Sep 2008
Posts
14,158
Location
Britain
I would just use Ajax and jQuery but I'm normally out of date with things like this!

If you need to pull the options from a database I'd use PHP etc else I'd just have them at options in the JS if they're not going to change.

Cool, I am of the same opinion but just (as I say) wanted a sanity check.
 
Back
Top Bottom