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

  • Home
  • SEARCH
  • 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 1022365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:27:16+00:00 2026-05-16T11:27:16+00:00

I am implementing an HTML form. For one of the fields (weather) the user

  • 0

I am implementing an HTML form. For one of the fields (weather) the user must choose one of a set of options (sunny, cloudy, rainy, etc.)

So basically I’m looking for a nice replacement for <select> or <radio> that provides a series of images (that I will provide) for the user to select from. I’ll create dulled/greyed versions of each image that represent unselected items.

I’ve found loads of jQuery rating controls that provide this, but nothing that quite does what I want (probably because I don’t really know what it’s called and therefore can’t Google it.)

Oh and if the user doesn’t have JavaScript enabled, it should degrade nicely to provide standard <select> or <radio> options.

  • 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-16T11:27:17+00:00Added an answer on May 16, 2026 at 11:27 am

    You could roll your own pretty easily. Start with markup like so:

    <fieldset>
        <input type="radio" name="weather" value="sunny" />
        <input type="radio" name="weather" value="cloudy" />
        <input type="radio" name="weather" value="rainy" />
        <input type="radio" name="weather" value="class-3-kill-storm" />
    </fieldset>
    

    Without javascript enabled, the users will get the above (you’d probably want to add some label elements so people knew what they were clicking ;). Next, loop through all of them and create the <a> elements you’ll need for your icons:

    $('input[name=weather]').each(function() {
        var radio = $(this);
        radio.css({display: 'none'});
    
        var icon = $('<a class="icon ' + this.value + '"></a>');
        icon.click(function(e) {
            // stop default link click behaviour
            e.preventDefault();
    
            // unmark any previously selected image and mark clicked selected
            icon.siblings('.icon').removeClass('selected');
            icon.addClass('selected');
    
            // set associated radio button's value
            radio.attr('checked', 'true');
        });
        $(this).parent().append(icon);
    });
    

    The reason I’m using an <a> is because IE will properly respect the :hover CSS pseudoclass. Also on that note, I’m using CSS spriting so you’d combine your greyed and full colour images into one 40px tall image with the grey version at the top.

    The css for the <a> would look something like:

    a.icon {
        float: left;
    
        /* width and height of your weather icons */
        width: 20px;
        height: 20px;
    
        background-repeat: no-repeat;
        background-position: 0 0;
    }
    
    a.selected,
    a:hover.icon {
        background-position: 0 -20px;
    }
    
    .sunny{
        background-image: url(sunny.png);
    }
    
    .rainy {
        background-image: url(rainy.png);
    }
    
    /* remaining weather styles */ 
    

    You can see a version using background colours in action here.

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

Sidebar

Related Questions

I am implementing an HTML form with some checkbox input elements, and I want
When implementing Quicksort, one of the things you have to do is to choose
I am implementing jQuery tabs on mysite, one of the tabs holds a form
HI, I started implementing a HTML Browser in Swing. I want to use the
I'm implementing CAPTCHA in my form submission as per Sanderson's book Pro ASP.NET MVC
Implementing Equals() for reference types is harder than it seems. My current canonical implementation
Implementing a 'sandbox' environment in Python used to be done with the rexec module
When implementing a needle search of a haystack in an object-oriented way, you essentially
I implementing a EventQueue and get notified when AWTEvents are send. I wait till
When implementing a singleton in C++, is it better for GetInstance() to return a

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.