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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:40:02+00:00 2026-06-03T18:40:02+00:00

Using jQuery UI I have two radio buttons, Approve/Reject, which I would like to

  • 0

Using jQuery UI I have two radio buttons, Approve/Reject, which I would like to style independantly, so when ‘Approve’ is selected, it will be blue, and when ‘Reject’ is selected, it will be red:

Nothing selected

Approve selected

Reject selected

Apologies for my terrible red button mockup 🙂 Hopefully this will give you an idea of what I’m after. I’ve tried changing the class of both buttons/labels, but this isn’t then reflected onto the jQuery-UI overlay.

Here’s my current code that is generating the buttons, and also displaying a tick or a cross depending on the selection:

$('.approvedToggle').buttonset();

$('input:radio').click(function() {
    if($(this).val() === 'approve') {
        $(this).parent('div').children(".tick").show();
        $(this).parent('div').children(".cross").hide();
    } else {
        $(this).parent('div').children(".tick").hide();
        $(this).parent('div').children(".cross").show();
    }
});

Any help would be much appreciated – 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-03T18:40:04+00:00Added an answer on June 3, 2026 at 6:40 pm

    What you need to do is override the jQuery UI default styling.

    Here’s what the documentation states:

    If a deeper level of customization is needed, there are
    widget-specific classes referenced within the jquery.ui.button.css
    stylesheet that can be modified. These classes are highlighed in bold
    below.

    Sample markup with jQuery UI CSS Framework classes

    <button class="ui-button ui-button-text-only ui-widget ui-state-default ui-corner-all"> <span class="ui-button-text">Button Label</span> </button>

    So basically, what you can do, is something like this:

    HTML:

    <div id="approvedToggle">
        <input type="radio" id="ApproveButton" name="radio" />
        <label id="ApproveButtonLabel" for="ApproveButton">Approve</label>
    
        <input type="radio" id="RejectButton" name="radio" />
        <label id="RejectButtonLabel" for="RejectButton">Reject</label>
    </div>​
    

    CSS (Important! This styling MUST be declared AFTER the jQuery UI CSS file):

    #ApproveButtonLabel.ui-state-active { background: blue; }
    #ApproveButtonLabel.ui-state-active span.ui-button-text { color: red; }
    
    #RejectButtonLabel.ui-state-active { background: red; }
    #RejectButtonLabel.ui-state-active span.ui-button-text { color: blue; }
    

    jQuery:

    $('#approvedToggle').buttonset();​
    

    Output:

    enter image description here

    See the working jsFiddle demo

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

Sidebar

Related Questions

I am using jQuery to customize some radio buttons. I have two different radio
I have two form fields and would like to post those values using jquery
I have two radio buttons on my form and up until I started using
I am using jQuery datepicker, I have two datepicker input fields, like following: <html>
I'm using jquery to render a like button on a story. I have two
I'm using the jQuery datepicker where I have two textboxes (start date / end
I'm using the jQuery Validation JS I have two contact forms, the main one
I have some tabs using jQuery UI which work just fine, but I want
So, I'm using Jquery and have two arrays both with multiple values and I
I have two problems relating to using Jquery mobile UI framework dropdown selectors when

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.