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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:53:39+00:00 2026-06-13T21:53:39+00:00

I need to disable/enable a.href links based on checkboxes being checked. I have a

  • 0

I need to disable/enable “a.href” links based on checkboxes being checked. I have a list of checkboxes (2 columns). When at least one checkbox in a column “install” is checked, “Install” link should be enabled, otherwise disabled. When at least one checkbox is checked in column “Remove”, a link with the same class name should be enabled, otherwise disabled.

I’ve tried with this but not sure if this is correct, it doesn’t work:

function refleshCheckboxes() {
    if ($("input:checked").length > 0) {
        $("input:checked").each(function(index, e) {
            var css = $(e).attr('class').split(' ').slice(-1);
            $("div.markActions a").each(function (index, e) {
                $(e).removeClass("disablelink").hasClass(css);
            });

        });
    }
    else {
        $("div.markActions a").addClass("disablelink");
    }
}

$(“div.markActions a”)
– this is where a.href links are (inside this div)

checkboxes have the same class name as the a.href links. So I would like to get the class name of checkbox and match that class with the class of the a.href link.

Checkbox:

<input type="checkbox" value="2" class="checkbox install">

Link:

<a class="iconDiskPlus install disablelink" href="#">Install</a>

enter image description here

  • 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-13T21:53:40+00:00Added an answer on June 13, 2026 at 9:53 pm

    I figured it out:

    function refleshCheckboxes() {
        if ($("input.checkbox:checked").length > 0) {
            var arr = new Array(".install", ".uninstalled", ".enabled", ".disabled", ".download", ".remove");
            for (i = 0; i < arr.length; i++) {
                if ($("input.checkbox:checked").is(arr[i])) {
                    $(".markActions a" + arr[i]).removeClass("disablelink");
                } else {
                    $(".markActions a" + arr[i]).addClass("disablelink");
                }
            };
        }
        else {
            $("div.markActions a").addClass("disablelink");
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Button on appwidget, that I need to 'enable'/'disable' programmatically from a
I need to disable slickgrid horizontal scrollbar. I have only one column and have
I've got checkbox and text input . What I need is to disable/enable the
I need to find all dijit.form.CheckBox widgets inside a DIV and enable/disable them all.
Usually they make another thing: enable/disable text input field when checkbox checked/unchecked, but i
I need to enable/disable a row columns of a datagridview this can be easily
I need to Enable/Disable my SAVE button in real time based on data in
I need to enable/disable a WPF button based on the return of a method.
I need to perform a few checks (enable or disable a label elsewhere on
I need to disable and enable the taskmanager from my application. I am doing

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.