Clicking on a disabled radio button

Stéphane Laurent

I want to disable a radio button but to be able to get the on-click event when it is disabled. Then I enclose the radio button in a div:

<div id="div_radio" display="block"><input type="radio" id="radio"/></div>

and I do, for example:

$("#div_radio").click(function(){
  $(this).hide();
});

You can try it here: http://jsfiddle.net/stla/6CKwk/2/

It works but one has to click not exactly on the radio button, and that is my problem. I have found several related questions on SO, but as a newbie in html/javascript it is possible that I have misunderstood some solutions.

A. Wolff

You could use pointer-events CSS property on modern browsers:

DEMO jsFiddle

$("#button").click(function(){
  $("#radio").prop('disabled',true).css('pointer-events','none');
});

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

disabled radio button check

Clicking on radio button

Radio button not clicking on single click

Clicking radio button Selenium/Python

Enabling a disabled button by clicking a different button

VueJS: clicking disabled button still changes route

problem in clicking radio button can't able to select a radio button

On clicking first radio button, automatically open radio button inside of that div

Showing tooltip on disabled radio button bootstrap 3

Find the closest radio button which is not disabled and checked it

Disabled radio button in simple_form with an array

Toggling a disabled radio button and changing checked value

HTML - custom radio button not toggled if clicking the text

How to select radio button by clicking its div?

Selecting a radio button when clicking an image

selenium - clicking on radio button generated by javascript

How to make a radio button unchecked by clicking it?

Enable <select> <option> after clicking radio button

Toggle HTML radio button by clicking its label

Executing radio button click upon clicking a link

Redirecting to a struts action on clicking on a radio button

how to check a radio button by clicking on a table row?

get the value of radio button by clicking on submit

Changing text when clicking radio button

clicking text should click the radio button in HTML

Filter user details when clicking on a radio button?

How to activate a cell on clicking a radio button in Excel?

Show multiple divs when clicking radio button

How to uncheck radio button upon double clicking?