<select onchange="location.href=this.value">
for($i=0; $i<$num;$i++)
{
$type-> next_record();
$option.="<option value='$PHP_SELF?select=".$type->f(ID)."'>".$type->f(TypeName)."</option>";
}
</select>
for($i=0; $i<$num;$i++)
{
$type-> next_record();
$option.="<option value='$PHP_SELF?select=".$type->f(ID)."'>".$type->f(TypeName)."</option>";
}
</select>
解决方案 »
- 请教sql语句
- PHPMailer奇怪的问题!加急!高分送上!
- 各位大大好,我是一个刚刚开始学习PHP的菜鸟,请各位大大给我看下这个是怎么回事!!!
- 一个MYSQL的语句,回者有分,答上来分多多!
- 求解:Lost connection to MySQL server during query
- 怎样计算两个日期相差的天数?
- 一个好的程序应该有尽量少的Mysql进程么
- 求用户关才IE时自动使用session_destroy()的方法
- textarea中数据显示问题,在线wait
- php的文件输出的问题
- 在iis如何在防火墙只打开80断口时,访问在去他断口下的web网页?
- 用什么方法把数据库中的东西打包,供用户下载?
javascript:location.href=this.options[selectedIndex].value
但不能定位它的selected
------------------------------
<?
function selected($value)
{
if($_GET['select']==$value)
echo "selected" ;
else
echo "" ;
}
?>
<form method="get" action="<?basename(__FILE__)?>">
<select name="select">
<option <?selected('aa')?>>aa</option>
<option <?selected('bb')?>>bb</option>
<option <?selected('cc')?>>cc</option>
</select>
<input type="submit">
</form>
<select name="select">
<option <?selected('aa')?>>aa</option>
<option <?selected('bb')?>>bb</option>
<option <?selected('cc')?>>cc</option>
</select>
<input type="submit"><script language="javascript">
document.frm.select.value = "aaa";
</script>
<select name="select">
<option value=1>aa</option>
<option value=2>bb</option>
<option value=3>cc</option>
</select>
<input type="submit"><script language="javascript">
document.frm.select.value = "aaa";
</script>
<?
for($i=0; $i<$num;$i++)
{
$type-> next_record();
$option.="<option value='$PHP_SELF?select=".$type->f(ID)."'>".$type->f(TypeName)."</option>";
}
echo "<select name='aa' id='aa'>".$option."</select>";
?>
<script language="javascript">
document.alll.aa.selectedIndex = 1
</script>
function selctedme1()
{
if(document.queryusergroup.InterestId.value!='')
{
location.href=this.options[selectedIndex].value
}
}
</script><?php
for($i=0; $i<$num;$i++)
{
$type-> next_record();
$option.="<option value='$PHP_SELF?select=".$type->f(ID)."'>".$type->f(TypeName)."</option>";
}
?>
<select name=selectpage onchange=selctedme1()><option >--choose--</option><?=$option?></select>