powersearch是form么?改成下面看看
<script language="javascript">
function submitform() {
document.powersearch.action="leave_list.jsp";
alert('dfgsdfgsdfg');
document.powersearch.submit();
}
</script>
<script language="javascript">
function submitform() {
document.powersearch.action="leave_list.jsp";
alert('dfgsdfgsdfg');
document.powersearch.submit();
}
</script>
powersearch不是表单的name(写成ID了)
有多于一个叫powersearch的对象
浏览器禁止了表单重定向
代码在哪里?
如果有就去掉
<form name="powersearch" method="post" action="leave_view.jsp">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
</head>
<body><form name="powersearch" action="abc">
<input >
</form><button onclick="submitform()">test</button><script language="javascript">
function submitform() {
document.powersearch.action="leave_list.jsp";
document.powersearch.submit();
alert('dfgsdfgsdfg');
}
</script></body>
</html>你的form里面是不是没有写初始的action?
请把你的全整的代码(既form中的内容帖出来)
这是另外一个例子,点击button_add也没反应
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../style.css" type="text/css">
</head>
<Script language="JavaScript">
<!--
function button1_click()
{
document.query.action="group_end.jsp";
if (inputTextCheck('组名要填写:',query.groupName)==true )
document.query.submit();}
function button2_click()
{
document.query.action="group_sav.jsp";
if (inputTextCheck('组名要填写:',query.groupName)==true )
document.query.submit();
}
function button3_click()
{
document.query.action="group_delet.jsp";
document.query.submit();
}
//-->
</Script>
<br> <form name="query" method="post" action="group_sav.jsp">
<table style={width="98%"} border="0" cellspacing="0" cellpadding="0" align="center" height="1">
<tr>
<td class=bgcolor1 ></td>
</tr>
</table>
<br>
<br>
<table border="0" width="100%" align="center">
<tr class="trLine1_1">
<td align="right" > <span class=text>类别:</span></td>
<td width="55%" >
<select name="className">
<option value="1">内部</option>
<option value="0">外部</option>
</select>
</td>
</tr>
<tr class="trLine1_1">
<td align="right" > <span class=text>组名:</span></td>
<td width="55%" >
<input type="text" name="groupName" size="16" >
</td>
</tr>
<tr class="trLine1_1">
<td align="right" > <span class=text>备注:</span></td>
<td width="55%" >
<textarea name="groupNote" cols="23" rows="10" wrap="VIRTUAL"></textarea>
</td>
</tr>
<input type="hidden" name="add" value="ad">
<tr>
<td align="right"> </td>
<td width="55%" height="50" align="right"><img src="/new_image/button_add.gif" height="20" onClick="button1_click()" style="cursor:hand"> <img src="/new_image/button_return.gif" height="20" onClick="history.back()" style="cursor:hand"></td>
</tr>
</table>
</form></html>
{
document.query.action="group_end.jsp";
//if (inputTextCheck('组名要填写:',query.groupName)==true )
document.query.submit();}