<%
Call Response.AddHeader( "Content-Type", "text/html; Charset=shift_jis" )
Response.ExpiresAbsolute=#May 31,2000 23:59:59#
Set MyData = Server.CreateObject("Scripting.Dictionary")
if Request.Form.Count <> 0 then
For Each strKey In Request.Form
MyData( strKey ) = Request.Form( strKey )
Next
end if
if Request.QueryString.Count <> 0 then
For Each strKey In Request.QueryString
MyData( strKey ) = Request.QueryString( strKey )
Next
end if
%>
' **********************************************************' サーバー関数' **********************************************************
function CreateOption( Cn, Rs, strName, Query )
Dim strRet
Call DBGet( Cn, Rs, Query, false )
Do While not Rs.EOF
strRet = strRet & "<OPTION value=""" & Rs.Fields(0).Value & """"
if Rs.Fields(0).Value & "" = MyData(strName) then
strRet = strRet & " selected "
end if
strRet = strRet & ">" & Rs.Fields(1).Value & "</OPTION>" & vbCrLf
Rs.MoveNext
Loop
CreateOption = strRet
end function
Dim strOptionstrOption = CreateOption( _
Cn, _
Rs, _
"section", _
"select 商品分類,名称 from 商品分類マスタ" _
)
%>
<FORM>
<SELECT
name=section
>
<%= strOption %>
</SELECT>
<INPUT type=submit name=send value="送信">
</FORM>
スクロール位置の復帰
<%
For i = 1 to 100
Response.Write i & "<br>"
Next
%>
<SCRIPT language=VBScript>
' **********************************************************' クライアント関数' **********************************************************
function frm_onSubmit()
document.all("SCROLL_Y").value = document.body.scrollTop
frm_onSubmit = True
end function
</SCRIPT>
<FORM name=frm>
<INPUT type=submit name=send value="送信">
<INPUT type=hidden name=SCROLL_Y>
</FORM>
<%
For i = 101 to 200
Response.Write i & "<br>"
Next
%>
<SCRIPT for=window event=onload language=VBScript>
<%
if MyData("SCROLL_Y") = "" then
MyData("SCROLL_Y") = "0"
end if
%>
document.body.scrollTop = <%= MyData("SCROLL_Y") %>
</SCRIPT>