Capture example code of select combo box option_form special effects
WBOYOriginal
2016-05-16 19:00:171061browse
This is a registration form that requires users to display the corresponding forms for "Types of interviewees available" and "Easily accessible industries" after selecting "Professional Interviewer" and "Qualitative Interviewer" respectively. When unselected, these two boxes are also hidden accordingly. html part
option cannot define events (I haven’t tried it), so events must be defined on select. The onchange event is used here. The onchange event is triggered when the object changes. Using onchange here is much more reasonable and effective than onclick. When debugging this script, I used selectedIndex at the beginning. After many experiments, I found that selectedIndex can only capture the first selected option in the case of multiple selections, and cannot handle multiple selections. After checking the reference book, I realized that I had taken a detour.
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn