I have a situation in which I need to do something when a user clicks off a page (via the back button, via another link within the website, closes the browser, etc.) Specifically, if the events mentioned above occur, I need to change a database table field value back to its original value. I am able to recognize the events mentioned above via JavaScript, but... I need to call a VBScript function within the JavaScript function. The VBScript function runs a stored procedure which will revert the database table value back to its original value.
I tried inserting some VBScript into the JavaScript function, and, what happens is, the VBScript is interpreted upon loading the page, rather than just sitting idle, and only firing when the JavaScript Function is itself fired.
here is the JavaScript function, if it helps. Also, note the ASP delimiters nested within the JS Function.
function updateStatus()
{
if (window.document.generate.ctr.value == '')
alert ("test"
;
//need to set status back to previous state
<%
'IMObject_changeStatus Request.QueryString("inqid"
,Request.QueryString("stat"
%>
}
Any help or direction is immensely appreciated!!
Regards,
dmill
======================================
"I wish that I may never think the smiles of the great and powerful a sufficient inducement to turn aside from the straight path of honesty and the convictions of my own mind."
-David Ricardo, classical economist
======================================
I tried inserting some VBScript into the JavaScript function, and, what happens is, the VBScript is interpreted upon loading the page, rather than just sitting idle, and only firing when the JavaScript Function is itself fired.
here is the JavaScript function, if it helps. Also, note the ASP delimiters nested within the JS Function.
function updateStatus()
{
if (window.document.generate.ctr.value == '')
alert ("test"
//need to set status back to previous state
<%
'IMObject_changeStatus Request.QueryString("inqid"
%>
}
Any help or direction is immensely appreciated!!
Regards,
dmill
======================================
"I wish that I may never think the smiles of the great and powerful a sufficient inducement to turn aside from the straight path of honesty and the convictions of my own mind."
-David Ricardo, classical economist
======================================