用了input type="file"的click方法后,submit必须点击两次才能提交
如题,如果不点击"参照"按钮,则点击一次submit按钮就可以提交。
一下是相关的jsp代码,请大家帮忙看看。
<html:html>
<head>
<script language="javascript">
function browse(field){
document.getElementsByName("F1")[0].click();
document.getElementsByName(field)[0].value = document.getElementsByName("F1")[0].value;
}
</script>
</head>
<body>
<html:form action="/noticeConfirm.do">
<table align="center" class="walkingModule">
<logic:notEqual name="NoticeDetailForm" property="noticeId" value="">
<p align="left" class="style1">
<input name="delete" type="button" onclick="deleteNoticeDetail();" value="削除" style="font-size:16pt;height:35px;width:100px;"/>
</p>
</logic:notEqual>
<tr>
<th>タイトル</th>
<td><html:text property="title" maxlength="64" style="width: 450px;"/></td>
</tr>
<tr>
<th>添付ファイル名称</th>
<input type="file" name="F1" style="position: relative;visibility: hidden">
<td>
<html:text property="urlA" style="width: 450px;"/><input type="button" value="参照..." onclick="browse('urlA')"><br>
<html:text property="urlB" style="width: 450px;"/><input type="button" value="参照..." onclick="browse('urlB')"><br>
<html:text property="urlC" style="width: 450px;"/><input type="button" value="参照..." onclick="browse('urlC')"><br>
<html:text property="urlD" style="width: 450px;"/><input type="button" value="参照..." onclick="browse('urlD')"><br>
<html:text property="urlE" style="width: 450px;"/><input type="button" value="参照..." onclick="browse('urlE')"><br>
</td>
</tr>
</table>
<p align="center" class="style1">
<input name="back" type="button" onclick="pageForward('noticeList.do');" value="戻る" style="font-size:16pt;height:35px;width:100px;"/>
<input name="subm" type="submit" value="確認" style="font-size:16pt;height:35px;width:100px;"/>
</p>
</br>
</html:form>
</body>
</html:html>