JavaScript Confirm Box
Hi guys,
I have an alert window that shows the action being done, but I would like to use a confirm window to to ask the user if he really want to perform that action, my question is How do I pass the value from that answer to a VBScript variable so I can then decide to perform that action or cancel it.
This is the code that I have now:
<%
if method = "DELETE" then
' Delete PL
strsql = "delete from ftx_bisi_pl where PL = '" & budel & "'"
set PLdelRS = eadoObj.SaveRecordsetQuery(CStr(strsql))
'Response.Write (strsql)
%>
<script language="JavaScript">
alert("Deleting PL successful!");
window.location="ProductionLine.asp";
</script>
<%
end if
%>
This is what I was thinking:
<script language="JavaScript">
var answer;
answer=window.confirm("Deleting PL successful!");
window.location="ProductionLine.asp";
</script>
<%
If answer then
' Delete PL
strsql = "delete from ftx_bisi_pl where PL = '" & budel & "'"
set PLdelRS = eadoObj.SaveRecordsetQuery(CStr(strsql))
'Response.Write (strsql)
end if
%>
=======================
Strange and crazy, but everything is possible
__________________
=======================
Strange and crazy, but everything is possible
|