📄 pro_edit.jsp
字号:
document.form1.PRO_ID.focus();
return false;
}
if((document.form1.PRO_NAME.value=='')||(chkspc(document.form1.PRO_NAME.value)==0))
{
alert("名字不能包含空格。");
document.form1.PRO_NAME.focus();
return false;
}
if(chksafe(document.form1.PRO_NAME.value)==0) {
alert("名字请输入合法的字符。");
document.form1.PRO_NAME.focus();
return false;
}
if(chksafe(document.form1.PRO_INTRO.value)==0) {
alert("请输入合法的字符。");
document.form1.PRO_INTRO.focus();
return false;
}
if(document.form1.PRO_INTRO.value=='') {
alert("简介不能为空。");
document.form1.PRO_INTRO.focus();
return false;
}
if((document.form1.PRO_PRI.value=='')||(chkspc(document.form1.PRO_PRI.value)==0))
{
alert("价格不能包含空格。");
document.form1.PRO_PRI.focus();
return false;
}
if((fucCheckNUM(document.form1.PRO_PRI.value)==0))
{
alert("价格不能包含非数字。");
document.form1.PRO_PRI.focus();
return false;
}
if((document.form1.PRO_VIP_PRI.value=='')||(chkspc(document.form1.PRO_VIP_PRI.value)==0))
{
alert("价格不能包含空格。");
document.form1.PRO_VIP_PRI.focus();
return false;
}
if((fucCheckNUM(document.form1.PRO_VIP_PRI.value)==0))
{
alert("价格不能包含非数字。");
document.form1.PRO_PVI_PRI.focus();
return false;
}
}
</SCRIPT>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="style.css">
<title>修改商品</title>
</head>
<title>无标题文档</title>
<style type="text/css">
<!--
.style2 {color: #FF0000}
-->
</style>
</head>
<body>
<div align="center">
<p>所有的选项都要求填写</p>
<p> </p>
<form action="pro_edit2.jsp" method="post" enctype="multipart/form-data" name="form1" onsubmit="return form1_onsubmit()" >
<input name="proidh" type="hidden" value="<%=proid%>"
<table width="527" border="1" cellspacing="1" bgcolor="#000000">
<caption align="bottom">
</caption>
<tr bgcolor="eeeeee">
<td width="273" height="39" valign="top" bgcolor="eeeeee">所属大类
<select name="CL1_NAME" size="1" id="CL1_NAME" onChange="changelocation(document.form1.CL1_NAME.value)" >
<%String name1=null;
sql="select * from Class1";
ResultSet rs = st.executeQuery(sql);
if(!rs.next()){
out.print("<option value=>请增加类别");
}else{
rs.absolute(1);
String CL1_NAME=null;
CL1_NAME=rs.getString("CL1_NAME");
if (cl1==CL1_NAME)
{out.print("<option selected value=" +CL1_NAME+">" +CL1_NAME+ "</option>");}
else{out.print("<option value=" +CL1_NAME+">" +CL1_NAME+ "</option>");}
while(rs.next()){
CL1_NAME=rs.getString("CL1_NAME");
if (cl1==CL1_NAME)
{out.print("<option selected value=" +CL1_NAME+">" +CL1_NAME+ "</option>");}
else{out.print("<option value=" +CL1_NAME+">" +CL1_NAME+ "</option>");}
}
}
%>
</select>
</td>
<td width="247" valign="top" bgcolor="eeeeee"><div align="left">所属小类
<select id="CL2_NAME" name="CL2_NAME" size="1">
<%
sql="select * from Class2 where CL1_NAME='"+cl1+"'";
rs=st.executeQuery(sql);
System.out.println("小类查询完毕");
System.out.println(sql);
if(rs.next())
{
System.out.println("小类存在");
rs.absolute(1);
System.out.println("小类存在22");
clname=rs.getString("CL2_NAME");
if(cl2==clname){
System.out.println("cl2==rs.getString-----CL2_NAME");
out.print ("<option selected value="+clname+">"+clname+"</option>");
}
else{
out.print ("<option value="+clname+">"+clname+"</option>");
System.out.println ("cl2!=rshujuxiang");
}
while(rs.next())
clname=rs.getString("CL2_NAME");
{if(cl2==clname){
out.print ("<option selected value="+clname+">"+clname+"</option>");
}
else{
out.print ("<option value="+clname+">"+clname+"</option>");
}
}
}
%>
</select>
</div></td>
</tr>
<tr bgcolor="eeeeee">
<td height="38"><div align="center">产品编号
<input name="PRO_ID" type="text" id="PRO_ID" value="<%=proid%>">
<span class="style2">数字</span></div></td>
<td><div align="center">产品名称
<input name="PRO_NAME" type="text" id="PRO_NAME" value="<%=pro_name%>">
</td>
</tr>
<tr align="center" valign="middle" bgcolor="eeeeee">
<td height="86" colspan="2"><p align="left">产品介绍</p>
<p> <textarea name="PRO_INTRO" cols="50" rows="6" id="PRO_INTRO" ><%=intro%></textarea>
</p></td>
</tr>
<tr bgcolor="eeeeee">
<td height="26">普通价
<input name="PRO_PRI" type="text" id="PRO_PRI" value="<%=pri%>" size="12">
元</td>
<td>会员价
<input name="PRO_VIP_PRI" type="text" id="PRO_VIP_PRI" value="<%=vip_pri%>" size="12">
元</td>
</tr>
<tr bgcolor="#eeeeee">
<td colspan="2"><div align="center">产品图片,如果要更换请点击 “浏览”<img src="propic/<%=pic%>" width="88" height="85">
<input name="PRO_PIC" type="file" id="PRO_PIC" size="50">
</div></td>
</tr>
<tr bgcolor="eeeeee">
<td colspan="2" bgcolor="eeeeee">
<div align="center">
<input type="submit" name="Submit" value="确认" >
</div></td>
</tr>
</table>
</form>
<p> </p>
</div>
</body>
</html>
<%
}
}
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -