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 6669961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:12:44+00:00 2026-05-26T03:12:44+00:00

I have the following code inside <table> tags. item is the result of the

  • 0

I have the following code inside <table> tags. item is the result of the query. When I click on the “(hide)” link display becomes “false” and the code below is executed. This gets the item that I want to hide from database by id and then changes display property from “True” to “False” and writes it to database. The problem is that since the link refers to the same page (/useradminpage) after the click, the page returns to the top. If the item is in page 2, and I click “(hide)”, it returns to the top of page 1. How do I fix this so that after I click the “(hide)” link it stays on the same place? I was trying to do this with javascript but I could not make it work. Thanks.

    ...
    for item in e:
        main_id = item.key().id()
        self.response.out.write("""
        <tr>
        ...
        <a href="/useradminpage?main_id=%s&display=false"> 
        <span class="small">(hide)</span></a>
        ...
        </td>
        </tr>""" % tuple([...main_id...]))

        #try to prevent default behavior; but this does not work
        self.response.out.write("""<script>
        $("a").click(function (evt){
        evt.preventDefault();
        }</script>""")

    self.response.out.write("""</tbody></table>""")    

    if display == "false":
        main_id = self.request.get("main_id")
        k = Main.get_by_id(int(main_id))
        k.display = False
        k.put()
  • 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-26T03:12:45+00:00Added an answer on May 26, 2026 at 3:12 am

    Taking a stab in the dark and guessing you’re referring to this?

    $("a").click(function (evt){
        evt.preventDefault();
    }
    

    Stops the page jumping back to the top

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Inside my template function I have the following code: TypeName myFunction() { TypeName result;
I have something like following code inside [XMLValue] column of a table called AlgorithmLog:
I have the following javascript code inside index.php: $(function () { $('.checkall').click(function () {
I have the following code inside a loop: Range(N & i + 1).Formula =
I have the following code with a bool if statement inside and in another
I have the following code: $(.perf-row).click(function(e) { if (e.target.tagName.toLowerCase() == a) { pageTracker._trackPageview($(this).attr(rel)); return
I have the following code inside a method: string username = (string)context[UserName]; string un
I have the following code that exports a csv file : //Selecting Item Data
I have a function with the following code that binds a table dynamically. I
i have the following code that does a image rollover on pictureboxes located inside

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.