select 传值问题
发表于:2007-07-01来源:作者:点击数:
标签:
? include(../include/opendb. php ); $sql=select username from user group by username order by id DESC; $rs=Execute($sql);$row=NumRows($rs); ? script function selectsubmit(form){ var username=?echo $username;?; window.location=a_controlmag.p
<? include("../include/opendb.
php");
$sql="select username from user group by username order by id DESC";
$rs=Execute($sql);$row=NumRows($rs);
?>
<script>
function selectsubmit(form){
var username="<?echo $username;?>";
window.location="a_controlmag.php?active=up&mselt="+mselt+"&username="+username;
}
</script>
<body><form name="form" method="post" action="">
<table width="100%" border="1" align="center">
<tr><
td width="10%">username</td><td width="30%">modify</td></tr>
<?while($row = FetchArray($rs)){?>
<tr><td><?=$row[username]?></td>
<?$sql1="select username from user where username = @#$row[username]@# ";
$rs1=Execute($sql1);$row1=NumRows($rs1);
?>
<td>
<input type="hidden" name="username" value="<?echo $row[username] ;?>">
<select name="mselt" id="select" onChange="selectsubmit(this.form);">
<option value="0" <?if($row1=="0"){echo "selected";}?>>closed</option>
<option value="1" <?if($row1=="1"){echo "selected";}?>>opened</option>
</select></td>
</tr><?}?></table></form></body>
请问点击选择框后如何得到mselt和username的值
原文转自:http://www.ltesting.net