<%@ page language="java" import="java.util.*" contentType="text/html;charset=gb2312"%>
<%@ page language="java" import="com.fredck.FCKeditor.*" %>
<%@ taglib uri="/WEB-INF/FCKeditor.tld" prefix="FCK" %>
<jsp:useBean scope="page" />
<jsp:useBean scope="page" />
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String dir=sn.getDir();
%>
<HTML><HEAD><TITLE>后台操作区</TITLE>
<LINK href="<%=basePath %><%=dir %>/images/Admin_Style.css" type=text/css rel=stylesheet>
<LINK href="<%=basePath %><%=dir %>/images/style.css" type=text/css rel=stylesheet>
<script type="text/javascript" src="<%=path %>FCKeditor/fckeditor.js"></script>
<STYLE type=text/css>
BODY {
MARGIN-LEFT: 0px; BACKGROUND-COLOR: #ffffff
}
.STYLE1 {color: #ECE9D8}
</STYLE>
</HEAD>
<script type="text/javascript">
function sub()
{
var form = document.getElementById('form1');
if(document.form1.name.value.replace(/\s+$|^\s+/g,"").length<=0||document.form1.age.value.replace(/\s+$|^\s+/g,"").length<=0
||document.form1.tel.value.replace(/\s+$|^\s+/g,"").length<=0||document.form1.remark.value.replace(/\s+$|^\s+/g,"").length<=0
||document.form1.address.value.replace(/\s+$|^\s+/g,"").length<=0)
{
alert("所有项目必须填写!");
return false;
}
form.submit();
}
</script>
<%
String message = (String)request.getAttribute("message");
if(message == null){
message = "";
}
if (!message.trim().equals("")){
out.println("<script language='javascript'>");
out.println("alert('"+message+"');");
out.println("</script>");
}
request.removeAttribute("message");
%>
<%
String username=(String)session.getAttribute("user");
if(username==null){
response.sendRedirect(path+"/error.jsp");
}
else{
String method=request.getParameter("method");
if(method==null){
method="addygzl";
}
//String wydz,String fx,String jzmj,String symj,String yzmc,String jg,String gzdw,String yb,
// String cwwz,String tczh,String wydz,String kssj,String jzsj,String bz
String name = "";
String age="";
String tel="";
String address="";
String remark="";
String;
if(method.equals("upygzl")){
id=request.getParameter("id").trim();
List newsList=tb.getOneYg(Integer.parseInt(id));
name=newsList.get(1).toString();
age=newsList.get(3).toString();
tel=newsList.get(4).toString();
address=newsList.get(5).toString();
remark=newsList.get(6).toString();
}
%>
<BODY onload="document.form1.infoContent.value=document.form1.content.value" >
<TABLE height="100%" cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD align="left" vAlign=top >
<table width='100%' cellspacing='1' cellpadding='3' bgcolor='#CCCCCC'>
<tr>
<td colspan="2">
<%
if(method.trim().equals("addygzl")){
%>
添加员工信息
<%}else{%>
修改员工信息
<%} %>
</td>
</tr>
<form name="form1" action="<%=basePath %>WyServlet" method="post" >
<tr bgcolor='#FFFFFF'>
<td width='30%'><div align="right">员工姓名:<input type="hidden" name="method" value="<%=method %>"> <input type="hidden" name="id" value="<%=id %>"></div></td>
<td ><input name="name" type="text" size="40" maxlength="100" value="<%=name %>"></td>
</tr>
<tr bgcolor='#FFFFFF'>
<td width='30%'><div align="right">性 别:</div></td>
<td ><input name="sex" type="radio" value="男" checked> 男 <input name="sex" type="radio" value="女"> 女 </td>
</tr>
<tr bgcolor='#FFFFFF'>
<td width='30%'><div align="right">员工年龄:</div></td>
<td ><input name="age" type="text" size="10" maxlength="100" value="<%=age %>"></td>
</tr>
<tr bgcolor='#FFFFFF'>
<td width='30%'><div align="right">联系电话:</div></td>
<td ><input name="tel" type="text" size="40" maxlength="100" value="<%=tel %>"></td>
</tr>
<tr bgcolor='#FFFFFF'>
<td width='30%'><div align="right">联系地址:</div></td>
<td ><input name="address" type="text" size="40" maxlength="100" value="<%=address %>"></td>
</tr>
<tr bgcolor='#FFFFFF'>
<td width='30%'><div align="right">备 注:</div></td>
<td ><textarea name="remark" cols=40 rows=5><%=remark %></textarea></td>
</tr>
<tr bgcolor='#FFFFFF'>
<td colspan="2" align="center">
<input'button' name='button' value='提交数据'>
</td>
</tr>
</table>
</form>
</TD>
</TR>
</TBODY>
</TABLE>
</BODY>
<%} %>
</HTML>
Shouted HELP ~ ah ~ ~ do not know why not submit submit, servlet category does not reflect, note web.xml in the relevant configuration information is accurate. ~ Graduation design anxious








Responses to “JavaScript in form.submit () does not respond to questions submitted”