不好意思 想請教各位高手
我有一隻上傳程式uploadfile.asp, 裡面會重新導向到主頁面adadd.aspResponse.Write "parent.location='../../?Action=adadd';"
請問我要怎麼避免主頁面已經填好的value被刷掉例如 input, select, 等欄位
例如asadd.asp:
<td>
<select name="siteclassid" id="siteclassid" style="width:400px;">
<option selected value="">請選擇分類</option>
<%
<option value="<%=Rs2("ID")%>"><%=Rs2("SiteClassName")%></option>
<%
%>
</select>
</td>
你要把值帶過去~
Response.Write "parent.location='../../?Action=adadd';"
改成
Response.Write "parent.location='../../?Action=adadd&siteclassid=1';"
然後在asadd.asp接值紀錄
siteclassid = request("siteclassid")
if siteclassid = "" then
siteclassid = 0
end if
然後在欄位把值帶入
<td>
<select name="siteclassid" id="siteclassid" style="width:400px;">
<option selected value="">請選擇分類</option>
<%
<option value="<%=Rs2("ID")%>" <%if siteclassid = Rs2("ID") then%>selected<%end if%>><%=Rs2("SiteClassName")%></option>
<%
%>
</select>
</td>
大大 抱歉我敘述的不清楚
asadd.asp 主頁面有一個 上傳圖片 的功能
<td colspan='6'><iframe style="top:2px" ID="UploadFiles2" src="../../include/uploadfile.asp?UserType=aduser&Site=imglist" frameborder=0 scrolling=no width="400" height="30" allowtransparency="true"></iframe></td>
點上傳功能會到uploadfile.asp 執行上傳相關作業
If UserType="aduser" Then
If Site="adadd" Then
Response.Write "parent.document.form_adadd.ad_2.value='" & RootPath & "upload/"&FileName_2 & "';" & vbcrlf
Response.Write "alert('上传成功!');" & VbCrlf
Response.Write "history.go(-1);" & vbCrlf
ElseIf Site="imglist" Then
Response.Write"parent.location='../"&AdUserManagePath&"/?Action=adadd';" & vbcrlf
Response.Write "alert('上传成功!');" & VbCrlf
End If
End If
請問包在iframe裡面會影響傳值嗎?
因為在iframe裡面的這句 parent.location 把你原本那頁轉址掉了@@..
所以在uploadfile.asp上傳前...
在uploadfile.asp裡面寫JS Code抓parent紀錄(asadd.asp)的相關值~
然後uploadfile.asp送出上傳後~連帶把值帶過去給
Response.Write"parent.location='../"&AdUserManagePath&"/?Action=adadd&xxx&xxx&xx';"
然後你被轉址的asadd.asp就會接到上傳頁的傳值了~
你在把接來的傳值重新設定到相關欄位的預設值裡面~
我推測應該是這樣的@@...
感謝各位大大的解答 這classic asp我真的不懂
他其實跟php是一樣的架構~
只是比.net架構簡單~隨意定義~
大大能在請問一個問題嗎?
uploadfile.asp裡面寫JS Code抓parent紀錄(asadd.asp)的相關值
請問這段JS Code怎麼寫... 能教教我嗎?
這個就要看asadd.asp相關欄位的原始碼了= =a
很麻煩的寫Js取值記錄到uploadfile.asp的表單欄位..
假設之前選的分類的變數叫 selectedClass
要改兩個地方
1.asadd.asp
原<option value="<%=Rs2("ID")%>"><%=Rs2("SiteClassName")%></option>
改成<option value="<%=Rs2("ID") @((selectedClass == Rs2("ID")) ? "selected" : "")%>"><%=Rs2("SiteClassName")%></option>
另外
在最前面加一列selectedClass = request.querystring("selcls")
2.Response.Write "parent.location='../../?Action=adadd';"
原Response.Write "parent.location='../../?Action=adadd';"
改成Response.Write "parent.location='../../?Action=adadd&selcls=ID03';"
注意:那個 ID03 要用你當時選擇分類的 ID,不是直接寫 ID03
Enjoyed reading the article above, really explains everything in detail, the article is very interesting and effective. Thank you and good luck with the upcoming articles
A2Z Full Form list
AMC Full Form list
A2Z Full Form
CFA Full Form
SDK Full Form
LLM Full Form
BMS Full Form
OBC Full Form
BLO Full Form
GNM Full Form
SWIFT Full Form
FICCI Full Form
PMC Full Form
SAT Full Form
ASMR Full Form
CEO Full Form
KYC Full Form
CNG Full Form
Radar Full Form
IAS Full Form
UGC Full Form
KPO Full Form
IT Full Form
PCB Full Form
PGDCA Full Form
KPMG Full Form
CSV Full Form
KGF Full Form
SSLC Full Form list
ETC Full Form list
AM Full Form list
INR Full Form list
AMC Full Form list
ASCII Full Form list
STD Full Form list
MS Full Form list
PNG Full Form list
PS Full Form list
A2Z Full Form
CFA Full Form
SDK Full Form
LLM Full Form
BMS Full Form
OBC Full Form
BLO Full Form
GNM Full Form
SWIFT Full Form
FICCI Full Form
PMC Full Form
SAT Full Form
ASMR Full Form
BIS Full Form
CA Full Form
LG Full Form
IT Full Form
Political Full Form
MP Full Form
DNB Full Form
PSI Full Form
VGA Full Form
GUI Full Form
MLC Full Form
VFX Full Form
RSA Full Form
NIC Full Form
EVM Full Form
Sinkoth :-)