Hi! I’m trying to link two dropdownlist depending on the value you select from the first dropdownlist. I don’t have any idea how to do this, so if you guys can point me in the right direction that would be great.
What I want to do is select a value from the first dropdownlist and depending on its value show some options in the second dropdownlist.
I try doing this:
1-when the “OnChange” event of the first dropdownlist occurs, I call a javascript that redirects to a method in a controller (for example: index/mainController/firstMethod/selectedValue).
2-the method in the controller using the url helper extracts the “selectedValue” to do a database search of the value of the second dropdownlist.
3-the same method loads the view (the one that have the ddl)
Doing this I lose the selected value of the first ddl.
I think this is not the right way to do it.
So, once again, I need some help.
Thanks for your time.