[php]代码库
< input type="button" value="delete" onclick="
if(confirm('确定要删除吗')) location.href=
'del_03.php?id=xing'">< br/>
< script language="JavaScript" type="text/javascript">
function select(obj){
window.location.href='del_04.php?myselect=
'+obj.options[obj.selectedIndex].value;
return; //可以不写;
}
< /script>
< input type="button" value="delete"
onclick="if(confirm('确定要删除吗'))
location.href='del_03.php?id=xing'">< br/>
< form name="myform" action="del_04.php"
method="post">
< !-- 直接触发onchange 事件 ,此时不用提交表单,-- >
< !--< select name="selectID" onchange=
"location='del_04.php?myselect='+this.options
[this.selectedIndex].value">-->
< !-- 把onchange 的事件写在一个函数里面-- >
< select name="selectID" onchange="select(this)">
< !-- < select name="selectID" >-->
< option value="0">请选择< /option>
< option value="value1">option1< /option>
< option value="value2">option2< /option>
< option value="value3">option3< /option>
< /select>
< input type="submit" name="sendSelect"
value="提交下拉框"/>
< /form>