Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 22nd, 2004, 04:03 PM
Authorized User
 
Join Date: Sep 2004
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP:Hyperlink problem

Hi,
 i need a help about this code.

while not rs.eof
response.write "<a href='mypage.asp?courseid=" & rs("courseid") & "'>" & rs("courseid") & "</a>"

  rs.movenext
wend

Once the user clicks the link i want to pop a message for confirmation,if he says yes then only i want him to redirect.iknow that a Javascript can do it,but how?Please help me how can i do that.
thanks!


 
Old September 22nd, 2004, 04:31 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Code:
<script language="javascript">
function ConfirmClick(strURL)
{
input_box=confirm("Click OK or Cancel to Continue");
if (input_box==true)
    location.href=strURL;
}
</script>
...
...
while not rs.eof
response.write "<a href='' onClick=""Javascript:ConfirmClick('mypage.asp?courseid=" & rs("courseid") & "');"">" & rs("courseid") & "</a>"

  rs.movenext
wend
Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old September 23rd, 2004, 10:34 AM
Authorized User
 
Join Date: Sep 2004
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for u r response vijay,but its not passing the URL to the Javascript function.strURL is null.Plese help.

 
Old September 23rd, 2004, 10:42 AM
Authorized User
 
Join Date: Sep 2004
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi its now working.what i did was at href='' i changed it as href='#' na dit works.Thanks Vijay.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Hyperlink in asp page ppenn Classic ASP Databases 2 September 27th, 2007 02:09 PM
HyperLink Problem monika.vasvani ASP.NET 1.0 and 1.1 Professional 2 September 30th, 2006 05:17 AM
Hyperlink Problem Lalit Pradhan ASP.NET 2.0 Professional 2 June 14th, 2006 09:36 AM
asp.net hyperlink problem brettdavis4 General .NET 9 November 10th, 2004 11:40 AM
Hyperlink in asp.net Jaco Jordaan ASP.NET 1.x and 2.0 Application Design 6 November 28th, 2003 07:15 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.