? Php's combination of Javascript and select components is used in the write process. I want to directly trigger the action without the submit button after the select object is selected, the selected options must be kept on the page after an action occurs. Finally, we can use Javascript and the onchange attribute and value of the select object to implement
// 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;
}
?>
[This article is copyrighted by the author and osuo. if you need to reprint it, please indicate the author and its source]
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service