下拉列表 [英] Drop Down Lists
问题描述
我有一个下拉列表,其中包含城镇选项''Bury''和''Ipswich'',如下所示:
。
选择时其中一个选项,其值传递给变量
$ townsearch。
如何更改下拉列表以便上次选择的选项为
然后是下拉框中显示的当前值?
< body>
<?php $ townsearch = $ _get [ '' 镇 '']; ?>
< form action ="<?php echo $ _SERVER [''PHP_SELF'']; ?>" method =" get">
< select size =" 1" name =" town">
< option> ipswich< / option>
< option> bury< / option>
& nbsp;
< / select>& nbsp;
< input type =" submit"值= QUOT; GO" />
< / form>
非常感谢
Alec
I have a drop down list with the town options ''Bury'' and ''Ipswich'' as
shown below.
When selecting one of the options, its value is passed to variable
$townsearch.
How do I change the drop down list so the option selected last time is
then the current one shown in the drop down box?
<body>
<?php $townsearch = $_get[''town'']; ?>
<form action="<?php echo $_SERVER[''PHP_SELF'']; ?>" method="get">
<select size="1" name="town">
<option>ipswich</option>
<option>bury</option>
</select>
<input type="submit" value="GO" />
</form>
Many thanks
Alec
推荐答案
townsearch。
如何更改下拉列表以便上次选择该选项是
然后下拉框中显示当前的那个?
< body>
<?php
townsearch.
How do I change the drop down list so the option selected last time is
then the current one shown in the drop down box?
<body>
<?php
townsearch =
townsearch =
_get [''town'']; ?>
< form action ="<?php echo
_get[''town'']; ?>
<form action="<?php echo
这篇关于下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!