|
-
Apr 30th, 2001, 03:40 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, 05:11 PM
#2
Fanatic Member
Try this:
Code:
function checkstuff()
{
if (conditions)
window.location = "somepage.html";
}
Then:
Code:
<a href="javascript:checkstuff()">text here</a>
Alcohol & calculus don't mix.
Never drink & derive.
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
|