<? Php
// 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;
}
?>
<Form name = "form1">
<Select name = "month_select"
OnChange = "javascript: location. href =
This. options [this. selectedIndex]. value ">
<Option> -- Select Your constellation -- </option>
<Option value = "test. php? Mon = 1"
<? Php if ($ mon = "1") echo "selected" ;?>> Aquarius </option>
<Option value = "test. php? Mon = 2"
<? Php if ($ mon = "2") echo "selected" ;?>> Pisces </option>
<Option value = "test. php? Mon = 3"
<? Php if ($ mon = "3") echo "selected" ;?>> Aries </option>
<Option value = "test. php? Mon = 4"
<? Php if ($ mon = "4") echo "selected" ;?>> Taurus </option>
<Option value = "test. php? Mon = 5"
<? Php if ($ mon = "5") echo "selected" ;?>> Gemini </option>
<Option value = "test. php? Mon = 6"
<? Php if ($ mon = "6") echo "selected" ;?>> Cancer </option>
<Option value = "test. php? Mon = 7"
<? Php if ($ mon = "7") echo "selected" ;?>> Leo </option>
<Option value = "test. php? Mon = 8"
<? Php if ($ mon = "8") echo "selected" ;?>> Virgo </option>
<Option value = "test. php? Mon = 9"
<? Php if ($ mon = "9") echo "selected" ;?>> Tianping seat </option>
<Option value = "test. php? Mon = 10"
<? Php if ($ mon = "10") echo "selected" ;?>> Scorpio </option>
<Option value = "test. php? Mon = 11"
<? Php if ($ mon = "11") echo "selected" ;?>> Sagittarius </option>
<Option value = "test. php? Mon = 12"
<? Php if ($ mon = "12") echo "selected" ;?>> Capricorn </option>
</Select>
</Form>
[This article is copyrighted by the author and osuo. If you need to reprint it, please indicate the author and its source]