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

  • Home
  • SEARCH
  • 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 6847569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:45:39+00:00 2026-05-27T00:45:39+00:00

I have a test page here: http://www.problemio.com/test.php and if you press Click To Test

  • 0

I have a test page here: http://www.problemio.com/test.php

and if you press “Click To Test Signup” you get a form. If on that form, you click “Log In” it recognizes that you clicked that, and opens the login form.

But the problem is that on the login form, if you press “create profile” it actually goes to the url of the href tag and not to the jQuery click event.

My quetion is what is the best practice of doing this? I hered of something called “prevent default behavior” but not sure how/when it should be used.

I am guessing that if the user has JS disabled, they should still be able to log in. How can I set it up so that users can log in and make accounts in the jQuery way first, and some default way if they have JS disabled?

Thanks!

  • 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-27T00:45:39+00:00Added an answer on May 27, 2026 at 12:45 am

    You can do this with pure jQuery with

     $("#createprofilelink").click(function(event) {
          event.preventDefault();
          {create profile logic}
     });
    

    more details of this can be seen in the jQuery documentation http://api.jquery.com/event.preventDefault/

    Edit: I removed this because of @maxedison comment that it stops the jQuery event from firing but I have just tested this and the jQuery event fires but the link does not go to the address.

     <a id="thelink" href="http://www.google.com" onclick="return false;">the link</a>
     <script>
          $('#thelink').click(function(){alert('alert me');});
     </script>
    

    As for the JS being disabled part of the question the link really should point to to a real form to fill in, as Taryn East correctly says, so the user gets the same functionality even if the user experience is lower by not using JavaScript.

    You could even go down the noscript route

      <noscript>
            <div>Your user experience would be far improved if you 
            enable JavaScript but if you insist, 
            <a href="{real link}">Click Here to create your profile</a></div>            
      </noscript>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on this test page: http://www.problemio.com/index_new.php and you see the categories that
Note: I'm using Google Chrome Currently I have this test page http://www.evecakes.com/doodles/canvas_size_issue.htm It should
I have a page that is accessed via a URL like this: http://power-coder.net/Test/something.php?id=3#Page1 I
http://blog.helpcurenow.org/test/mockups/mar2010/lp.html In the above landing page, I have an offers box that has four
I have a very simple test page for PHP session. <?php session_start(); if (isset($_SESSIONS['views']))
I have a page located at x.com. On this page is a button that,
Im using the plugin detailed here: http://www.thatagency.com/design-studio-blog/2009/01/refreshing-an-element-at-a-set-time-interval-using-jquery-and-a-sprinkle-of-ajax/ Here is my jQuery: $(document).ready(function(){ var j
I have a simple login page and the URL structure is like www.mydomain.com/admin/auth I
I am setting up a simple test page in Python. I only have two
I've tryed mylyn but i cant find that feature, if anyone have test mantis

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.