The combination of JavaScript and select parts
In the process of writing the program, I want to implement the Select object after selecting the option,
does not need to submit the button, but directly triggers the action, and after the action has occurred
You want to keep the selected option in the page. After description, finally passed
Use the OnChange property of JavaScript and select objects and
Value to achieve this function.
The code is as follows (the file name is "test.php"):
Switch ($mon) {
Case ': Echo ' Please select your constellation: ';
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 ' n ': Echo ' Your constellation is the Scorpion ';
Default:break;
}
?>
The above introduces the use of JavaScript and select components in PHP, including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.