select 传值问题 - 中国WEB开发者网络 (http://www.webasp.net) -- 技术教程 (http://www.webasp.net/article/) --- select 传值问题 (http://www.webasp.net/article/14/13236.htm) |
| -- 作者:未知 -- 发布日期: 2004-09-20 |
| <? 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的值 |
| webasp.net |