|
-
Apr 30th, 2001, 03:39 PM
#1
Thread Starter
Junior Member
Hyperlinks that only fire if certain conditions are met
Help! Is there any way to have a hyperlink <a href = .......> fire conditionally or only if certain criteria are met. In other words, if the user clicks on the hyperlink, I want to first call a function to make sure that certain conditions are true, and if not, then cancel the navigation to the hyperlink. Unfortunately, I can’t use the “navigate “ function (I think it’s a function anyway) for this purpose which would have worked nicely. Any help would be greatly appreciated.
-
Apr 30th, 2001, 09:01 PM
#2
Lively Member
Yes you can! Set up your hyperlink like this:
Code:
<a href="vbscript: checkValues()">My Link</a>
Now create your function to check the values you want to change. After you check the values in your function use document.url:
Code:
document.url = "http://www.yahoo.com"
This example was for javascript. Not sure what the function for javascript would be...I'll dig around and see. Document.url may work.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|