The combination of JavaScript and select parts in PHP

Source: Internet
Author: User
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.

  • Contact Us

    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

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.