While doing something in HTML, I have encountered this scenario. I know it's doable because somebody on the internet already have solve this, but I want to know how would you guys code this little challenge(??) problem.
Okay here is an overview of the problem: I have two radio buttons in the form. When I select one of the option, the values inside the SELECT tag will be populated with different choices and when I select the other one, the choices on the SELECT will be different form the previous.
See below:
===============================
If option 1 is selected the values of the SELECT option are as follows:
If option 2 is selected, the values int he SELECT option are as followsCode:(*) Option 1 ( ) Option 2 Choices +------------------------+ |-- Choice A-------------| |-- Choice B-------------| |-- Choice C-------------| |-- Choice D-------------| +------------------------+
Code:( ) Option 1 (*) Option 2 Choices +------------------------+ |-- Choice 1-------------| |-- Choice 2-------------| |-- Choice 3-------------| |-- Choice 4-------------| |-- Choice 5-------------| +------------------------+
A challenge for enthusiasts, how would you implement it? You can use: HTML | PHP | JavaScript | AJAX/JSON (if you must) | Python(?)
Good Luck!![]()




Reply With Quote
) ... i just think that the auto population routine should be done only once and not everytime the user clicks an option. then CSS can be used to satisfy the problem's requirement of toggling which <select> to display.
sorry kayo ug sayop gani ako pagsabot.