Click on a specific option within a disabled Twitter Bootstrap table to change its style

I'm currently working on a page that features a Bootstrap 3 table. This table includes multiple links and I want to disable these links when a certain option is selected.

Although I have successfully implemented the link disabling functionality, I now need to style it in such a way that the end user can visually see that the table has been disabled.

This is the code I am using:

 <table class="table table-hover table-striped hidden-xs" id="clientListTable">
        <tr>
            <th>
                <a href="<%=Html.GenerateLoopBackUrl(true, new { ClientList_SortOn = cell.SortOn, ClientList_SortDirection = sortDirection })%>"><%=cell.Value%></a>
                <%if (showFilterOption)
                    { %> 
                        <a href="#" id="<%:cell.ColumnIdentifier%>_link" class="noPdf">
                            <span class="glyphicon glyphicon-filter" id="<%:cell.ColumnIdentifier%>_img"></span>
                        </a>
                <%}%>
            </th>
        </tr>
        <tr>
            <%
                foreach (var cell in row.Cells)
                {
                    if (cell.Hidden) { }
                    else {%><td onclick="return clickDisableFunction();"><%=cell.Value%></td><%}
                }
            %>
        </tr>

Here is my JavaScript code:

 var clickedOnce = false;

function clickDisableFunction()
{
   if (clickedOnce == true)
   {
       return false;
   };
   clickedOnce = true;
   document.getElementById('clientListTable').setAttribute("disabled","true")
};

While this setup functions correctly, users may not be aware that all other links are disabled when they click one. I would like to make the table fade out (turn a light grey) when a link is clicked.

Below is a screenshot of the table in question.

The only thing left to do is add a fading effect to the table when a link is clicked.

Answer №1

Opted to utilize the modal as a viable solution and it is functioning effectively

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Warning: Promise rejection was not handled (rejection id: 3)

As a newcomer to the world of await, I'm struggling to handle errors and rejections properly. The unhandled rejections from the shopify-api.js function keep cropping up, and I can't seem to print all the errors that are coming from my middleware ...

Ways to customize hover color of Bootstrap 5 Dropdown menu

I'm having trouble modifying the hover color for a dropdown menu using Bootstrap 5. I'm unsure of the correct method to achieve this. The desired outcome is as follows: However, at the moment it appears like this: Apologies for the oversight, h ...

What is the best way to implement the settimeout method in react?

I need assistance on how to effectively utilize the setTimeout() method in my code. Specifically, I am looking to trigger a click event on an element after a certain delay and execute a function afterwards. Here is the current implementation of my code: ...

"Utilize Angular's $http module to execute a POST request for

Hey everyone, I'm a beginner with AngularJS and I've run into a problem while working on my project. I encountered this error: ReferenceError: $http is not defined when attempting to utilize the following code: 'use strict'; ...

Receive suggestions through AJAX based on the input provided

Seeking to improve autocomplete functionality on my website, I aim to suggest usernames from my database as users type. The standard method involves using autocomplete's source, but with a vast number of usernames on my site, managing one large string ...

Change the position of a div by clicking on different content menu buttons to make it go up

I have implemented move up and move down buttons in my context menu for multiple div drops. However, I am facing an issue with moving the div down after clicking the move down button. Here is the code snippet that I am currently using: $(".propertyClass" ...

Is there a quicker method to access an object's ID?

Within my array of objects, the structure is as follows: var locations = [ [{id: 1, lat: 51.52376322544537, lng: 5.13785702262885, content: 'Title A'}], [{id: 2, lat: 51.52358632767757, lng: 5.137921395645208, content: 'Title B'}], [{i ...

Change the price directly without having to click on the text field

Our Magento marketplace site is currently utilizing the code below for updating prices. However, we are looking to make the price field editable without requiring a click on the textfield. This means that users should be able to edit the price directly wi ...

What is the correct method for adjusting the height properties of an element?

I'm trying to adjust the height of my div using the code below var heightMainDiv = window.innerHeight - 50; var myDiv = $("#main_content")[0]; myDiv.clientHeight = heightMainDiv; myDiv.scrollHeight = heightMainDiv; However, the values of clientHeigh ...

Why isn't the background color displaying for the child text element during animation?

My search boxes are arranged in a grid layout with the use of the display: grid property. When I click on or focus on the <input type="text"> elements in column 1, the text elements within the <span> tag with class names placeholder2, ...

Implementing Vuejs sorting feature post rendering

Currently, I have elements linked to @click event listeners. <th @click="sort('dateadded')" class="created_at">Date Added I am looking for a way to automatically trigger this sorting function when the Vue.js component renders, so that th ...

JavaScript lacks support for linear transformation and matrix multiplication functions, causing them to be

Currently, I am delving into the complexities of linear algebra and experimenting with crafting a simple program that incorporates fundamental linear transformations (rotating, scaling, translating). Behold, here is a fully functional example: https://cod ...

Issue with CSS transition bug in Offcanvas on Android version 4.1.x

I am attempting to develop an offcanvas menu similar to the one featured in the Google Plus app. Currently, my code functions properly on most devices (android/ios) and browsers (ff, chrome, IE8+). The only issue I am encountering is on a Samsung Galaxy ...

Exploring Angular 2 Beta 8: An Introduction to @Query Usage

My attempt to utilize @Query to fetch data regarding an element in my template has not been successful. I made an effort using the following approach: Referenced here. Here is a snippet of my code, import {Component, Query, QueryList, ElementRef} from &a ...

Comparing tick and flushMicrotasks in Angular fakeAsync testing block

From what I gathered by reading the Angular testing documentation, using the tick() function flushes both macro tasks and micro-task queues within the fakeAsync block. This leads me to believe that calling tick() is equivalent to making additional calls pl ...

Having issues with AngularJS ng-if when implemented within a Form

Is there a way to hide my form after it has been submitted using ng-if? I am facing an issue where clicking the 'See' button toggles the form on and off, but the same functionality does not work with the 'Add' button. Any insights on wh ...

Is there a method to add HTML code statically rather than in a dynamic environment?

I'm currently in the process of developing a front-end website with no backend code, as I plan to host it on GitHub pages. I feel that adding any additional backend functionality would be unnecessary. Is there a simple method to incorporate common el ...

The implementation of j-query form validation results in automatic redirection of the page

When writing validation code in jQuery, everything seems to be working fine except for one thing - if the user fills in all the details and submits the form, the page gets redirected. This is how my form code looks like: <form action="/process.php" me ...

Trying to conceal the scrollbar on MS Edge and Firefox?

Currently, I am working on a scrollable menu that requires the scrollbar to be hidden. In Chrome, I have achieved this by using the following code: .menu::-webkit-scrollbar { display: none; } I would like to know if there is an equivalent solution ...

Scroll to the top of jQuery DataTables when clicking pages in a random order from the bottom to the top and

In my current project, I am working with jQuery Datatables and I need to customize its default behavior. Currently, when I navigate to page 61, the page scroll remains at the bottom of the page. However, if I then click on a lower page number like 60, th ...