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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:38:52+00:00 2026-05-26T13:38:52+00:00

I have a page where everything is working fine, but the one problem is

  • 0

I have a page where everything is working fine, but the one problem is that after setting a hidden element to being shown, my page suddenly jerks up. The previously hidden element does get displayed, but I would like the page not to jerk up.

Here is the page: http://www.problemio.com/add_problem.php

When you add anything to the 3rd input area and click the link for “add category” the page jerks up to the top. If you scroll down, you can see that a previously hidden text box is shown, but how can I stop the jerking up of the page?

Here is my jQuery code:

$(‘#add_category’).click(function()
{
//alert (“in add category”);
// Now have to get value of the text entry area
var category = $(“#category_field”).val(); // Works

     var text_area = $("#log").val();        
     //alert ("text_area: " + text_area);

     // Should append to value of textarea what is in the category
     if ( text_area )
     {
         //alert ("text area NOT EMPTY: " + text_area + " and category: " + category );
         text_area = text_area + " , " + category;    
     }
     else
     {
         //alert ("text area EMPTY: " + text_area + " and category: " + category );
         text_area = category;          
     }    

     // Now replace old text_area with new one
     $("#log").val(text_area); 

     // Now reset the text field
     $("#category_field").val("");

     // Make the categories box visible 
     document.getElementById("categories_box").style.display = 'block';

});

and here is the HTML form:

         <form id="create_problem" name="form" method="post">
                 <p>
                 <label for="problem_name">Problem Name: </label><input type="text" value="<?php echo $problem_name;?>" size="75" name="problem_name" id="problem_name"></input>
                 </p>
                 <p>
                 Explain the problem:
                 </p>

         <textarea id="content" name="content" class="tinymce" style="width: 500px; height: 350px;">
         </textarea>
        </p>

    <p class="ui-widget">
        <label for="category_field">Category: </label> 
        <input id="category_field" size="25"/> <a id="add_category" href="#">Add Category</a>
    </p>

    <p id="categories_box" class="ui-widget" style="margin-top:2em; font-family:Arial; display: none;">
        Categories:<br />
        <textarea id="log" style="height: 150px; width: 500px;" ></textarea>
    </p>

        <span class="error"   id="categories_error" style="display:none">Categories Can Not Be Empty</span>
        <span class="success" id="categories_success" style="display:none">Categories Added Successfully!</span>    

                 <input type="hidden" id="question_html" name="question_html" />

                 <!-- Check if the person is logged in -->
<!--
                 <p>
                    <input class="problem_follow_checkbox" TYPE="checkbox" NAME="follow_problem" /> Follow this problem        
                 </p>
-->



<span class="error" style="display:none"> Please Enter Valid Data</span>
<span class="success" style="display:none"> Problem Added Successfully!</span>

        <input type="submit" class="button" value="Add Problem"></input>

<form>

Specifically the line that is doing this is the last line in the jQuery, which tries to display the element like this:

document.getElementById("categories_box").style.display = 'block';

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-26T13:38:53+00:00Added an answer on May 26, 2026 at 1:38 pm

    You need to return false; in tha last line of

    $('#add_category').click(function() {
         var text_area = $("#log").val();        
         //alert ("text_area: " + text_area);
    
         // Should append to value of textarea what is in the category
         if ( text_area )
         {
             //alert ("text area NOT EMPTY: " + text_area + " and category: " + category );
             text_area = text_area + " , " + category;    
         }
         else
         {
             //alert ("text area EMPTY: " + text_area + " and category: " + category );
             text_area = category;          
         }    
    
         // Now replace old text_area with new one
         $("#log").val(text_area); 
    
         // Now reset the text field
         $("#category_field").val("");
    
         // Make the categories box visible 
         document.getElementById("categories_box").style.display = 'block';
    
    return false;
    });
    

    Not returning false creates the # at the top of the page;

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

Sidebar

Related Questions

I have a nice page that does everything I need. However one of the
I have newly registered my domain and everything is working fine but when i
A have a problem with PHP application, that I'm working on. Main page which
i have this jquery colorpicker from http://www.eyecon.ro/colorpicker/ , everything is working fine but i
Here's the problem: 1.) We have page here... www.blah.com/mypage.html 2.) That page requests a
I have successfully wired up a Facebook Connect application and everything is working fine.
I just figured out that I have a problem in IE while working with
I've a Mac server and everything working fine I'm running a wordpress and have
I'm having some problems with ActiveRecord. Well everything works fine, but it's working sometimes.
I have a page that is generated which inserts an HTML comment near the

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.