我在<html:form>里加了onsubmit=...后,jsp页面上的表单的内容就不显示了。详细如下。<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@page contentType="text/html"%>
<%@page pageEncoding="gb2312"%>
<html><head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>员工所属添加(新增)</title></script>
</head><body><hr>
<p align="center">员工所属添加(新增)</p>
<hr>
<p>请输入以下项目(*为必选项目)</p>
<html:errors/>
<html:javascript formName="SearchForm" />
<html:form action="sinki_baocun.do" onsubmit="return validateSearchForm(this)">//调试的时候,发现只执行到上面这一行。
<table border="0" width="100%" id="table1">
<tr>
<td width="138" bgcolor="#C0C0C0">姓名(汉字)*</td>
<td><html:text property="name" size="20"/>(不超过10文字)</td>
</tr>
<tr>
<td width="138" bgcolor="#C0C0C0">拼音*</td>
<td><html:text property="pinyin" size="20" value=""/>(不超过20字)</td>
</tr>
<tr>
<td width="138" bgcolor="#C0C0C0">所属*</td>
<td>
<html:select property="ju" value="0" >
<html:options collection="ju_list" property="id" labelProperty="name"/>
</html:select>局
<html:select property="bu" value="0" >
<html:options collection="bu_list" property="id" labelProperty="name"/>
</html:select>部
<html:select property="ke" value="0" >
<html:options collection="bu_list" property="id" labelProperty="name"/>
</html:select>科</td>
</tr>
<tr>
<td width="138" bgcolor="#C0C0C0">性别</td>
<td>
<html:select property="sex" value="0">
<html:option value="0">---</html:option>
<html:option value="1">male</html:option>
<html:option value="2">female</html:option>
</html:select></td>
</tr>
<tr>
<td width="138" bgcolor="#C0C0C0">入职年月</td>
<td><input type="text" name="ymd" size="20"> (YYYY/MM/DD)</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td height="28" colspan="2">
<p align="center">
<html:submit value="确定"/>
<input type="submit" value="返回" onclick="javascript:window.history.go(-1)"></td>
</tr>
</table>
</html:form></body></html>
请帮忙,谢谢。
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@page contentType="text/html"%>
<%@page pageEncoding="gb2312"%>
<html><head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>员工所属添加(新增)</title></script>
</head><body><hr>
<p align="center">员工所属添加(新增)</p>
<hr>
<p>请输入以下项目(*为必选项目)</p>
<html:errors/>
<html:javascript formName="SearchForm" />
<html:form action="sinki_baocun.do" onsubmit="return validateSearchForm(this)">//调试的时候,发现只执行到上面这一行。
<table border="0" width="100%" id="table1">
<tr>
<td width="138" bgcolor="#C0C0C0">姓名(汉字)*</td>
<td><html:text property="name" size="20"/>(不超过10文字)</td>
</tr>
<tr>
<td width="138" bgcolor="#C0C0C0">拼音*</td>
<td><html:text property="pinyin" size="20" value=""/>(不超过20字)</td>
</tr>
<tr>
<td width="138" bgcolor="#C0C0C0">所属*</td>
<td>
<html:select property="ju" value="0" >
<html:options collection="ju_list" property="id" labelProperty="name"/>
</html:select>局
<html:select property="bu" value="0" >
<html:options collection="bu_list" property="id" labelProperty="name"/>
</html:select>部
<html:select property="ke" value="0" >
<html:options collection="bu_list" property="id" labelProperty="name"/>
</html:select>科</td>
</tr>
<tr>
<td width="138" bgcolor="#C0C0C0">性别</td>
<td>
<html:select property="sex" value="0">
<html:option value="0">---</html:option>
<html:option value="1">male</html:option>
<html:option value="2">female</html:option>
</html:select></td>
</tr>
<tr>
<td width="138" bgcolor="#C0C0C0">入职年月</td>
<td><input type="text" name="ymd" size="20"> (YYYY/MM/DD)</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td height="28" colspan="2">
<p align="center">
<html:submit value="确定"/>
<input type="submit" value="返回" onclick="javascript:window.history.go(-1)"></td>
</tr>
</table>
</html:form></body></html>
请帮忙,谢谢。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货