Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6079797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:59:16+00:00 2026-05-23T10:59:16+00:00

in html, <a href=/shop/view-item.php onclick=checklogin();>View Item</a> As you know, the execution order is, 1)

  • 0

in html,

<a href="/shop/view-item.php" onclick="checklogin();">View Item</a>

As you know, the execution order is,

1) onclick javascript function, checklogin,
2) go to href link, and page refresh, /shop/view-item.php

And if you add ‘return false’ in onclick function’s foot,
href doesn’t work. so the page remain on the same page. The code is,

<a href="/shop/view-item.php" onclick="checklogin();return false;">View Item</a>

My question,
Can I control ‘return false’ effect?
If user do not log, I want to user remain the same page with alert logging request.
If user logged already, let him go the anchor’s link url.

Is it possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:59:16+00:00Added an answer on May 23, 2026 at 10:59 am

    Make sure your checklogin() function will return true or false appropriately, then do the following:

    <a href="/shop/view-item.php" onclick="return checklogin();">View Item</a>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

there is a script in my html tag <script type=text/javascript> function setTaxDisplay(display) { window.location.href
I'm trying to extract each a href link on an html page for evaluation
I know SWT has a Link class to create HTML a href style links
I have an HTML page which contains an href tag. On clicking href link,
How should I quote this: <tr onclick=$.colorbox({href:'information1.html'});> When put in an echo ; ?
How to get the contents of an href attribute on an HTML page, based
I have some code like below $(html).on(change, input['data-href'], function() { var href, obj, params;
I am using the location.href = html page to move one html page to
The response is a HTML document (from a request from a link's href) var
I want to get the value of href links on a html page.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.