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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:13:00+00:00 2026-06-15T22:13:00+00:00

i have an inbox section on my site where users can click the subject

  • 0

i have an inbox section on my site where users can click the subject heading to open a window and read their messages.

I have put in a javascript function that highlights the inbox messages as they move the cursor along. I have made the highlight clickable and it’s suppose to go to the same location as if the user clicked on the subject link and whilst it goes to the window read_message.php its not loading the message id and the message wont show.

Heres the subject link that works:

<?php echo "<strong><a href=\"read_message.php?msg={$inbox['message_id']}\">{$inbox['subject']}</a></strong>"; ?>

and heres the javascript with link that isn’t working:

<script>
     $(function() {
        $('tr').hover(function() {
            $(this).css('background-color', '#eee');
            $(this).contents('td').css({'border': '0px solid red', 'border-left': 'none', 'border-right': 'none'});
            $(this).contents('td:first').css('border-left', '0px solid red');
            $(this).contents('td:last').css('border-right', '0px solid red');
        },
        function() {
            $(this).css('background-color', '#FFFFFF');
            $(this).contents('td').css('border', 'none');
            $('tr').click(function() { 
    document.location = "<?php echo "read_message.php?msg={$inbox[0]}" ?>";
} );
        });
    });
    </script>

hope someone can let me know where i’m going wrong. 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-06-15T22:13:01+00:00Added an answer on June 15, 2026 at 10:13 pm

    Firstly you should move the .click() function so it’s not inside your .hover() function – otherwise the click handler gets set every time you mouse out of the row, and it won’t work the first time you mouse over.

    Once that’s done, you could do this:

    $("tr").click(function() {
      location.href = $(this).find("a[href*='read_message.php']").attr("href");
    });
    

    (Not 100% certain on the .find() syntax since I don’t really use jQuery, but this should help)

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

Sidebar

Related Questions

I'm able to read SMS Inbox and display all messages. I have two problems.
I have created an inbox system. Signed in user can message other signed in
I have a program which reads Inbox messages from email accounts, as the title
I have PM Inbox and 2 Tables: Users and Admins. I have this query:
In a project we're doing, we have created an inbox where the users (amongst
i have got ListView of Inbox SMS.I am trying, if i click on any
I have tried to program a inbox that display messages in the order they
I have database table Inbox(id,accountid,emailfrom,emailsubject,emailbody, recieveddate,attachment, read(bool) i have added it to the form
I have created a method for reading inbox new messages by using exchange server
I have this method to display the contact numbers in my inbox: public ArrayList<String>

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.