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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:16:25+00:00 2026-06-07T05:16:25+00:00

I have been developing some page and I need to clear a content of

  • 0

I have been developing some page and I need to clear a content of some div:

                <table>
                    <tbody>
                    <div class="records_content">
                        <?php
                            $i=0;
                            foreach ($records as $record) {
                                echo "<tr class = 'output' style='border-bottom: 1px dotted silver;'>";
                                echo "<td width='400'>" . strip_tags($record['language_value']) . "</td>";
                                if ($record['approved_translation'])
                                {
                                    echo "<td width='200' height='30'><div class='field' id='".$record['label_value']."/".$record['language_id']."'>".
                                        strip_tags($record['approved_translation']['language_value'])."</div></td><td><button class='btn btn-info' id='{$record['label_value']}/{$record['language_id']}' href='#'>More...</button>"."</td>";
                                }
                                else
                                {
                                    echo "<td  width='200'>"."<div id='".$record['label_value']."/".$record['language_id']."'><span class='no_translate'>Not translated</span></div>" . "</td>";   
                                }                   
                                echo '</tr>';
                                $i++;
                            }
                        ?>
                    </div>
                    </tbody>
                </table> 

Piece of JS code:

           $(".page_button").click(function () {
                $.post("http://"+document.location.host+"/index.php/welcome/update_records_set/"+this.id,
                    function(data)
                    {
                        alert('123');
                        $(".records_content").empty();
                    });
            });

This script works, because I see ‘123’ notification, but div container with ‘.records_content’ class isn’t clear. Please, tell me, how can I fix it? Thank you.

UPDATE:
Now it works. But I have a new problem with pagination:

                <br><b>Page:</b><br/>
                <?php
                    for($i=0; $i<$count; $i++)
                    {
                        if ($i==0)
                        {
                            echo "<div class='selected_page_button'>".($i+1)." "."</div>";
                        }
                        else
                        {
                            echo "<div class='page_button'>".($i+1)." "."</div>";
                        }
                    }
                ?>

And code for changing class of button:

                $(".page_button").click(function () {

                    $(".selected_page_button").attr("class", "page_button");
                    $(this).attr("class", "selected_page_button");
                });

It works correctly for all buttons without first. When my page is created the first page is selected. When I click by “2”, then “1” is simple and “2” is selected. The same thing is with all buttons without “1”: if I click by “2” (or other one) then I can’t click by first! “1” changes it’s view but doesn’t change behavior, because simple button is clickable and selected button is not clickable!

  • 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-06-07T05:16:27+00:00Added an answer on June 7, 2026 at 5:16 am

    It does clear using .empty() as your code already states, except that it clears after the alert. See here: http://jsfiddle.net/YPLeB/

    After you click “OK”, the DIV is cleared as expected.

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

Sidebar

Related Questions

I have been developing an application that can publish content like some sort of
I have been developing some Android application and I need to catch some events:
I have been developing the application for drawing and I have some problems: the
I have been developing with objective C and the Cocoa framework for quite some
I have been developing a script on my linux box for quite some time,
I have been developing the application for drawing and I need to detect double
I have been developing some Django app and there's some duplicated code for different
I have been developing some software and want to give it version numbers. How
Its been quite some time since i have started developing web pages using JSF
I used PHP years ago but have since been developing in C#/VB.Net. In ASP.Net

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.