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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:17:17+00:00 2026-05-19T04:17:17+00:00

I have a private messaging system and would like to have about 4-5 links

  • 0

I have a private messaging system and would like to have about 4-5 links above the inbox where a user can click if they want to “select all”, “none”, “favourite”, “read” or “unread” messages.

How would I do this using jquery/javascript? Are there any tutorials about that explain this thoroughly? I am not that great with javascript but I’m a quick learner.

I originally really wanted to do a gmail style checkbox drop down but it is proving to be quite difficult and I think having links across of the message inbox would be more user friendly..

  • 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-19T04:17:18+00:00Added an answer on May 19, 2026 at 4:17 am

    My solution on jsFiddle: http://www.jsfiddle.net/pereskokov/sYe4S/6/

    HTML:

    <p id="links">
        Select <a href="#" id="all" class="pseudo">all</a>, 
        <a href="#" id="none" class="pseudo active">none</a>, 
        <a href="#" id="unread" class="pseudo">unread</a>, 
        <a href="#" id="read" class="pseudo">read</a>, 
        <a href="#" id="fav" class="pseudo">favourite</a>
    </p>
    <p id="messages">
        <label class="unread">
            <input type="checkbox" name="message" value="1" class="unread" /> Hi, man!
        </label><br/>
        
        <label class="read fav">
            <input type="checkbox" name="message" value="2" class="read fav" /> Cute kittens, look
        </label><br/>
        
        <label class="read">
            <input type="checkbox" name="message" value="3" class="read" /> Pysh-pysh, ololo
        </label><br />
        
        <label class="unread">
            <input type="checkbox" name="message" value="4" class="unread" /> New important task!
        </label><br/>
    </p>
    

    CSS:

    label.unread {
        font-weight: bold;
    }
    
    label.fav {
        background-color: #F5E942;
    }
    
    a.pseudo {
        text-decoration: none;
        border-bottom: 1px dashed #4998C9;
        color: #4998C9;
    }
    
    a.active {
        background-color: #4998C9;
        color: white;
        padding: 0 0.2em;
    }
    

    jQuery:

    $('#links').delegate('a', 'click', function(ev) {
        // reset all checkboxes
        $('input:checkbox').attr('checked', false);
        
        // get info, what is the user choice
        whichMessages = $(this).attr('id'); 
      
        // do our main work - select checkboxes
        switch (whichMessages) {
        case 'all':
            $('input:checkbox').attr('checked', true);
            break;
        case 'read':
            $('input:checkbox.read').attr('checked', true);
            break;
        case 'unread':
            $('input:checkbox.unread').attr('checked', true);
            break;
        case 'fav':
            $('input:checkbox.fav').attr('checked', true);
            break;
        };
    
        // add some user-frendly markup
        $('#links a').removeClass('active');
        $(this).addClass('active');
                      
        // and standart action to prevent standart link click event
        ev.preventDefault();
    });
    

    Excuse me, I am the man, who gave you fish, but did not teach you to catch fish.

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

Sidebar

Related Questions

I'm designing a C#/NHibernate website that features a private messaging system. I would like
Take facebook's private messaging system where you have to keep track of sender and
I've been reading this post Creating a threaded private messaging system like facebook and
I have a Private messaging system using PHP and mySQL with notification. The database
im trying to create a simple private messaging system i have a nested route
i'm working on a private messaging system , it looks more like a social
i created a messaging model where a user can send a private message to
Why can NHibernate create a proxy for classes with properties that have private setters
I have a private function like this in my controller. private UserDetails GetUserDetails(int userid)
I have a private project, and i want it hosted on google code. this

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.