Calling a vbscript function within a javascript event onUnlo

admin

Administrator
Staff member
function hello()
{
var x;
x = "<%call unsetFlagUpdate(strAccntNum)%>";

return true;

}

<body onUnload="hello();">


i have tried using this code but unfortunately when the page loads it already calls the unsetFlagUpdate vbscript function even though the hello() javascript function has not been called yet..is there another way that you could suggest where in i call a vbscript function on the onunload event of javascript?


and here is the function in vbscript..

--------------------

Function unsetFlagUpdate(strAccnt)

aConnectionString = "File Name=" & onRequestConnection()

set conn = Server.CreateObject("ADODB.Connection")
conn.Mode = adModeReadWrite
conn.ConnectionString = aConnectionString
conn.open

strSQL = "Update TBLCACS " _
& "set FlagUpdate = 0 " _
& "where CARDNUMBER = '" & strAccnt & "'"

conn.execute strSQL,,adCmdText

end Function
---------------------

thanks a bunch,
biktoryah
 
Back
Top