'How to exchange form based on selected option in form select element?
Info: On the website I am programming no JavaScript or comparable criminal stuff is allowed! If code is run it is run on the server only, no visitor machine is abused.
I would like to change the form elements dynamically with CSS, based on a
<form><select></select></form>
element.
Means, CSS should detect the selection and exchange the opacity levels of the selectable forms as well as setting the content of other fields to None. That way it would be possible to change dynamically between different forms to be submitted.
However, if that is not possible, I would also be OK with replicating this <select> element in HTML as a lookalike, e.g. as a radio type HTML element.
But I would strongly prefer if I could just use a select field without much design work. I think it should work.
Thanks for potential help!
Solution 1:[1]
OK, I think I just read the answer.
I was confused that there was no equivalent like :checked for options, since an option is more "selected" than "checked".
However, according to the following site, option:checked should also work.
https://developer.mozilla.org/en-US/docs/Web/CSS/:checked
Now I feel a bit silly. Apologies for asking this question :)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Wilddeerpony |
