Karl - This is supposed to be client side stuff. There is no need to post
back to the server if the client is not interested in canceling the
transaction. The onclick event is calling a client side sub defined in a
script block.
Henrique - This is being done in vbscript because the javascript
confirmation dialog doesn't allow you to specify the text on the buttons and
it can get confusing for an end user to confirm cancelation with an Okay
button and Cancel cancelation with a "Cancel" button which is what they used
to get the confirmation window to begin with. With the vbscript messagebox
I can display Yes and No buttons instead.
So the problem seems to be that the input element is causing a postback
which is canceling the redirect?
Is there a way in VBscript to keep this from happening so I can keep my Yes
and No buttons.
I'm really not interested in creating a custom dialog for this so I can make
it more user friendly with javascript...
Thanks for the responses.
Jerry
<rl*****@newsgroups.nospam> wrote in message
news:Of**************@tk2msftngp13.phx.gbl...
Looking to do something pretty simple... I have a cancel button on my
page. When the user clicks it, i want to verify they want to cancel and if so,
redirect them.
Code:
-------------------------------------------------------------
<html>
<script language=vbscript>
if MsgBox("Testing",4) = 6 Then
window.location = "http://www.google.com"
End if
</script>
</html>
--------------------------------------------------------------
This code works just fine like that, but when I place it in a sub
procedure and call it in response to an onclick event, the redirect never happens.
I even placed an alert box in the if block ot verify that I was getting into
the block. I got the alert, but no redirect. Why doesn't this work in
repsonse to an onclick event, but it deos work by itself in a separate
page? Thanks.
Jerry