: This article mainly introduces the use of Javascript and select components in php. if you are interested in the PHP Tutorial, please refer to it.
// Use javascript and select components in combination
// In the process of writing a program, after selecting the select object option,
// You do not need to submit a button, but directly trigger the action.
// To keep the selected options on the page. Finally
// Use the onchange attribute and
// Value to implement this function.
// The code is as follows (the file name is "test. php "):
Switch ($ mon ){
Case '': echo 'select your Constellation:'; break;
Case '1': echo 'Your constellation is Aquarius '; break;
Case '2': echo 'Your constellation is Pisces '; break;
Case '3': echo 'Your constellation is Aries '; break;
Case '4': echo 'Your constellation is Taurus '; break;
Case '5': echo 'Your constellation is Gems'; break;
Case '6': echo 'Your constellation is Cancer '; break;
Case '7': echo 'Your constellation is Leo '; break;
Case '8': echo 'Your constellation is Virgo '; break;
Case '9': echo 'Your constellation is tianping'; break;
Case '10': echo 'Your constellation is Scorpio '; break;
Case '11': echo 'Your constellation is Sagittarius '; break;
Case '12': echo 'Your constellation is Capricorn '; break;
Default: break;
}
?>
The above describes the combined use of Javascript and select components in php, including the content, and hope to be helpful to friends who are interested in PHP tutorials.