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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:33:15+00:00 2026-05-13T17:33:15+00:00

I am have a table that shows the user suggestions that they have recieved

  • 0

I am have a table that shows the user suggestions that they have recieved on clicking read more some ajax is fired and in the database the suggestion is marked as read. Currently if the suggestion is new I show a closed envelope, if it is read I show an open envelope, however I can get it to reload the table when the user clicks the read more link so that the new class can be added. Currently it half works, they click read more and the full suggestions fades in but I need the envelope to change also.

    <table>
        <?php
            $colours = array("#f9f9f9", "#f3f3f3"); $count = 0;
            if(isset($newSuggestions)) {
                foreach($newSuggestions as $row) {
                if($row['commentRead'] == 0) {
                    $newRow = "new";
                } else {
                    $newRow = "old";
                }
        ?>
                        <tr id="a<?=$row['thoughtId'];?>" bgcolor="<?php echo $colours[$count++ % count($colours)];?>">
        <?php
                            echo "<td class='".$newRow."'>".substr($row['thought'], 0,50)."...</td>";
                            echo "<td class='read'><a href='".base_url()."thought/readSuggestion/".$row['thoughtId']."' class='readMore'>Read More</a>";
                        echo "</tr>";
                    }
                } else {
                echo "You have no new suggestions";
                }
        ?>
        </table>
    </div><!--/popular-->

    </div><!--/widget-->
        <div id="readMore">

        </div>

<script type="text/javascript">
    $(document).ready(function() {
    //alert("hello");
    $('#tabvanilla').tabs({ fx: { opacity: 'toggle', height:'toggle' } });
        $('a.readMore').click(function(){
            $('#readMore').fadeIn(500);
            var url = $(this).attr('href');

            $.ajax({
                url : url,
                type : "POST",
                success : function(html) {
                    $('#readMore').html(html)
                },
                complete : function(html) {
                    $('table').html()
                }
            });
            return false;
        });
});
</script>
  • 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-13T17:33:15+00:00Added an answer on May 13, 2026 at 5:33 pm

    In the JavaScript where you open/fill in the full suggestions, you can modify the envelope image as well, using something like:

    $('#envelope').attr('src', 'src/to/envelope.png');
    

    I see no img tags, so you need to add one and fill in the id, so it is found by the JavaScript.

    BTW: Having HTML and PHP on the same lines/parts, makes the total very unreadable. Only use <?php ... ?> for large PHP code blocks, otherwise use echo (or something similar).

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

Sidebar

Related Questions

I have a following table using MVC that shows number of items the user
I have some code that shows results in a table Right now it will
I have a table that shows the relationships between people a bit like this.
I have a data.frame and I'm trying to create a frequency table that shows
I have the following table, Persons_Companies , that shows a relation between persons and
I have an application that shows data from a MySQL table. Basically, my application
i have an orders table that has a userID column i have a user
I have a product table that contains thousands of products. Some products are available
I want a jTextField that shows suggestions in a popup as the user types
I have a gridview that displays the contents of a database table, using an

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.