MsgBox Yes/No onClick before a a href 
Author Message
 MsgBox Yes/No onClick before a a href

How can I do an onClick on an anchor tag and do a response.redirect?

Example:
I am on a page.
I click the anchor and I get a MsgBox asking if I am sure I want to Go?
vbYesNo
if the answer is vbNo then I want to stay on this page.
But when returning from the onClick sub the anchor takes over to leave
the page.
I guess I am asking how to stop the anchor tag from taking the
priority??????Thanks

* Sent from RemarQ http://www.*-*-*.com/ The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



Thu, 19 Dec 2002 03:00:00 GMT  
 MsgBox Yes/No onClick before a a href
RoyHawkins says:

Quote:
>How can I do an onClick on an anchor tag and do a response.redirect?

>Example:
>I am on a page.
>I click the anchor and I get a MsgBox asking if I am sure I want to Go?
>vbYesNo
>if the answer is vbNo then I want to stay on this page.
>But when returning from the onClick sub the anchor takes over to leave
>the page.
>I guess I am asking how to stop the anchor tag from taking the
>priority??????Thanks

Return a "false" value .


Fri, 20 Dec 2002 03:00:00 GMT  
 MsgBox Yes/No onClick before a a href

It's tough going trying to cancel a link using VBScript alone. My
workaround is to use Javascript inline to enable the use of the return
keyword for events. Something like this.

<HTML><body><script language="vbs">
Function verify()
    verify = CBool(7 - MsgBox("Do you want to go to" &_
                 " Microsoft's site?",vbYesNo))
End Function
</script>
<a href="http://www.microsoft.com" language="jscript"
            onclick="return verify()">MICROSOFT</a>
</body></HTML>



: How can I do an onClick on an anchor tag and do a response.redirect?
:
: Example:
: I am on a page.
: I click the anchor and I get a MsgBox asking if I am sure I want to
Go?
: vbYesNo
: if the answer is vbNo then I want to stay on this page.
: But when returning from the onClick sub the anchor takes over to
leave
: the page.
: I guess I am asking how to stop the anchor tag from taking the
: priority??????Thanks
:
:
: * Sent from RemarQ http://www.remarq.com The Internet's Discussion
Network *
: The fastest and easiest way to search and participate in Usenet -
Free!
:



Fri, 20 Dec 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Yes no Msgbox?

2. VBScript for yes/no msgbox ?

3. onclick on href?

4. problem with onclick in HREF

5. MsgBox with vbQuestion YES/NO

6. "Yes/no to all" msgbox

7. MsgBox and "Yes to All"

8. "Yes/no to all" msgbox

9. "Yes / Yes to All/ No / Cancel" MsgBox?

10. Problem: Setting MSIE iframe innerHTML change relative href/src to absolute href/src

11. <a href= .. onClick="jscriptfunction">

 

 
Powered by phpBB® Forum Software