Combined use of JavaScript and select parts
In the process of writing a program, I want to implement the option that is selected when the Select Object
does not need to submit the button, but directly triggers the action, and after the action occurs
To keep the selected option on the page. After being described, finally passed
Using JavaScript and the onchange properties of the Select object and
Value value to achieve this function.
The code is as follows (file name is "test.php"):
Switch ($mon) {
Case ': Echo ' Please select your constellation: '; break;
Case ' 1 ': Echo ' your constellation is Aquarius ';
Case ' 2 ': Echo ' Your constellation is Pisces ';
Case ' 3 ': Echo ' Your constellation is Aries ';
Case ' 4 ': Echo ' Your constellation is Taurus ';
Case ' 5 ': Echo ' Your constellation is Gemini ';
Case ' 6 ': Echo ' Your constellation is cancer ';
Case ' 7 ': Echo ' Your constellation is Leo ';
Case ' 8 ': Echo ' your constellation is Virgo ';
Case ' 9 ': Echo ' your constellation is Libra ';
Case ' Ten ': Echo ' Your constellation is Scorpio ';
Case ' one ': Echo ' Your constellation is Sagittarius ';
Case ' a ': Echo ' Your constellation is the Scorpion ';
Default:break;
}
?>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.