I'm working with a form with a radio button which is part of a set of radios and just one can be selected at a time(no problem with the single selection). One of those radios must fire a code each time it's selected a diferent code when it is unselected (another radio is selected), im using .change
method and it fires the code when you click it, but not when it looses the selection. What i want is to toggle or be able to know when it looses the selection.
I could do it adding code to the other radios .change
method but there are many sets of radios and it would be painful, i'm looking for a one time config.
Edit
The markup is made of ASP MVC Razor engine like this:
@Html.RadioButtonFor(x => x.SomeModel, new { @class = "special-radio" })
@* Other radios but without the 'specia-radio' class *@
js:
// logging
$(function(){
$('.special-radio').change(function(){
console.log('change');
});
});
The string change only appears when you click the 'special-radio' radio.