
struts中提交表单按钮,为什么必须点击2次才能提交
<%@pagelanguage="java"contentType="text/html"pageEncoding="UTF-8"%><%@taglibprefix="s...
<%@ page language="java" contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<HTML>
<HEAD>
<TITLE>试题信息管理</TITLE>
<script type="text/javascript">
function change(){
document.getElementById("examQuestion.strExamQuestionType").value=document.getElementById("examQuestion.strExamTypeId").value;
}
</script>
</HEAD>
<body>
<s:form name="examQuestion" method="post" theme="simple" target="Frame" onsubmit="return v.exec()" namespace="/examQuestion" action="save?isNew=true" enctype ="multipart/form-data">
<table class="query" ><tr>
<td class="query_left_td03">附件名称:</td>
<td class="query_right_td03">
<s:textfield cssClass="textbox" name="examQuestionAttachment.strAttachmentName" maxlength="100"/>
</td>
<td class="query_left_td03">附件简述:</td>
<td class="query_right_td03" colspan="3">
<s:textarea name="examQuestionAttachment.strAttachmentDescription" cssClass="textarea"></s:textarea>
</td>
</tr>
<tr>
<td class="query_left_td03">附件:</td>
<td class="query_right_td03" colspan="5">
<input type="file" name="file" id="file"/>
<s:textfield name="examQuestionAttachment.strAttachment" cssClass="file_textbox" readonly="true"/>
<input name="button" type='button' class="button_out"
onClick='document.all.file.click();document.all("examQuestionAttachment.strAttachment").value=document.all("file").value;'
onMouseOver="this.className='button_over'"
onMouseOut="this.className='button_out'"
value='浏览...'>
<input name="button2" type="button" class="button_out"
onClick='document.all("examQuestionAttachment.strAttachment").value="";document.all("examQuestionAttachment.strAttachment").outerHTML=document.all("examQuestionAttachment.strAttachment").outerHTML;'
onMouseOver="this.className='button_over'"
onMouseOut="this.className='button_out'"
value="删除">
</td>
</tr>
</table>
<table class="button_table" >
<tr>
<td>
<s:submit type="submit" cssClass="button_out"
onmouseover="this.className='button_over'"
onmouseout="this.className='button_out'"
value="提交" />
<input type="button" class="button_out"
onMouseOver="this.className='button_over'"
onMouseOut="this.className='button_out'"
onClick="javascript:history.back();" value="返回" >
</td>
</tr>
</table>
</s:form>
</body>
</html> 展开
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<HTML>
<HEAD>
<TITLE>试题信息管理</TITLE>
<script type="text/javascript">
function change(){
document.getElementById("examQuestion.strExamQuestionType").value=document.getElementById("examQuestion.strExamTypeId").value;
}
</script>
</HEAD>
<body>
<s:form name="examQuestion" method="post" theme="simple" target="Frame" onsubmit="return v.exec()" namespace="/examQuestion" action="save?isNew=true" enctype ="multipart/form-data">
<table class="query" ><tr>
<td class="query_left_td03">附件名称:</td>
<td class="query_right_td03">
<s:textfield cssClass="textbox" name="examQuestionAttachment.strAttachmentName" maxlength="100"/>
</td>
<td class="query_left_td03">附件简述:</td>
<td class="query_right_td03" colspan="3">
<s:textarea name="examQuestionAttachment.strAttachmentDescription" cssClass="textarea"></s:textarea>
</td>
</tr>
<tr>
<td class="query_left_td03">附件:</td>
<td class="query_right_td03" colspan="5">
<input type="file" name="file" id="file"/>
<s:textfield name="examQuestionAttachment.strAttachment" cssClass="file_textbox" readonly="true"/>
<input name="button" type='button' class="button_out"
onClick='document.all.file.click();document.all("examQuestionAttachment.strAttachment").value=document.all("file").value;'
onMouseOver="this.className='button_over'"
onMouseOut="this.className='button_out'"
value='浏览...'>
<input name="button2" type="button" class="button_out"
onClick='document.all("examQuestionAttachment.strAttachment").value="";document.all("examQuestionAttachment.strAttachment").outerHTML=document.all("examQuestionAttachment.strAttachment").outerHTML;'
onMouseOver="this.className='button_over'"
onMouseOut="this.className='button_out'"
value="删除">
</td>
</tr>
</table>
<table class="button_table" >
<tr>
<td>
<s:submit type="submit" cssClass="button_out"
onmouseover="this.className='button_over'"
onmouseout="this.className='button_out'"
value="提交" />
<input type="button" class="button_out"
onMouseOver="this.className='button_over'"
onMouseOut="this.className='button_out'"
onClick="javascript:history.back();" value="返回" >
</td>
</tr>
</table>
</s:form>
</body>
</html> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询