?? edit.asp
字號(hào):
<%@Language=vbscript.encode%>
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=gb2312">
<!-- #include file="../inc/css.asp" -->
<%
'定義變量
dim Number,opFlag,title,image,i,addtemp,mFiledsCount
on error resume next
addtemp=0
'獲取輸入?yún)?shù):記錄號(hào)和操作標(biāo)志
Number=request("Number")
if Number="" then Number="0"
Number=Cint(Number)
opFlag=request("opFlag")
'創(chuàng)建記錄訪問對(duì)象
Set rs = Server.CreateObject("ADODB.Recordset")
'初始化參數(shù)
'打開記錄源,并定位到輸入?yún)?shù)決定的記錄號(hào)
rs.Open Session("SQLFULL"),oconn,1,3
if rs.eof then
rs.addnew
addtemp=1
end if
rs.move Number
if Number=rs.recordcount then rs.movelast
image=Session("mImage")
title=Session("mTitle")
dim FieldsInfo,t2,t4,t6,t1,t3,t5,temp1,temp2,temp3
Redim FieldsInfo(3,Session("mFiledsCount"))
t2=1
t4=1
t6=1
For i=1 to Session("mFiledsCount")
t1=instr(t2,Session("mFiledsWidths"),",")
t3=instr(t4,Session("mFileds"),",")
t5=instr(t6,Session("mFiledsCaptions"),",")
temp1=mid(Session("mFiledsWidths"),t2,t1-t2)
temp2=mid(Session("mFileds"),t4,t3-t4)
temp3=mid(Session("mFiledsCaptions"),t6,t5-t6)
t2=t1+1
t4=t3+1
t6=t5+1
FieldsInfo(1,i)=temp1
FieldsInfo(2,i)=replace(temp2,"^",",")
FieldsInfo(3,i)=temp3
Next
dim list1,list2
list1="'" & replace(Session("mFileds"),",","','")
list1=left(list1,len(list1)-2)
list2=""
mFiledsCount=rs.Fields.count-1
For i=1 to mFiledsCount
if instr(FieldsInfo(2,i)," ")<=0 then
if rs(i-1).Type>200 then
list2=list2 & "'" & FieldsInfo(2,i) & "','','R',"
else
list2=list2 & "'" & FieldsInfo(2,i) & "','','RisNum',"
end if
end if
next
list2=left(list2,len(list2)-1)
%>
</head>
<script language=javascript>
function OnInput(n)
{
//'rphtml(<%=list1%>);
if(n==2)
{
submitinput.action="save.asp?opFlag=cmdAddNew&Number=<%=Number%>&id=<%=rs("tempid")%>"
}
//if(MM_validateForm(<%=list2%>))
document.all.submitinput.submit();
}
</script>
<body scroll=yes id=all>
<form name="submitinput" method="post" action="save.asp?opFlag=<%=opFlag%>&Number=<%=Number%>&id=<%=rs("tempid")%>">
<!-- #include file="../inc/title.asp" -->
<table align="center" width="95%" cellpadding="0" border="0" cellspacing="1" bgcolor="#49A7F4">
<%
for i=0 to mFiledsCount-1%>
<tr valign="top" class=vtext>
<td width="20%" valign="middle" bgcolor=#49A7F4 height="25" align="right" >
<b><%=FieldsInfo(3,i+1)%></b>:</td>
<td bgcolor="<%=Session("vcolcolor")%>" width="80%">
<%
dim txxstr1,txxstr2
select case opFlag
case "cmdAddNew"
txxstr1=""
if instr(FieldsInfo(2,i+1)," ")>0 then txxstr1=txxstr1+ " readonly "
txxstr2=" >"
case "cmdEdit"
txxstr1=" value='" & rs(i).value & "' "
if instr(FieldsInfo(2,i+1)," ")>0 then txxstr1=txxstr1+ " readonly "
txxstr2=" >" & rs(i).value
case else
txxstr1=" value='" & rs(i).value & "' readonly "
txxstr2=" readonly>" & rs(i).value
end select
if rs(i).DefinedSize<=255 then
response.write "<input name='"& rs(i).name &"' id='"& FieldsInfo(3,i+1) &"' type=text maxlength='" & rs(i).DefinedSize & "' style='width=100%;border:none' " & txxstr1 & " >"
else
response.write "<textarea name='"& rs(i).name &"' id='"& FieldsInfo(3,i+1) &"' rows='8' style='width:100%;border:none' " & txxstr2 & "</textarea>"
end if
' response.write replace(rs(i).value,chr(13),"<br>") & " "
%>
</td>
</tr>
<%next%>
</table>
<p align=center>
<%if opFlag="cmdEdit" or opFlag="cmdAddNew" then%>
<button class=vinputbutton style="height=24" onClick="javascript:OnInput(2);"><img src="images/save1.gif" align="absmiddle"> 另存為</button>
<button class=vinputbutton style="height=24" onClick="javascript:OnInput(1);"><img src="images/save1.gif" align="absmiddle"> 保存</button>
<%end if%>
<button class=vinputbutton style="height=24" onClick="javascript:history.go(-1);"><img src="images/back.gif" align="absmiddle"> 返回</button>
</p>
</form>
</body>
</html>
<%
if addtemp=1 then rs.delete
rs.update
rs.close
set rs=nothing
%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -