Last active
May 9, 2016 14:50
-
-
Save mick88/42aef3ae5b5bbed9ef288888c2bd4fa2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Radio select toggler | |
* enables radio buttons to be toggled when clicked | |
* Created by Michal on 09/05/2016. | |
*/ | |
var radios = $('input[type=radio]'); | |
/** | |
* Adds click listeners to all checkboxes to unselect checkbox if it was checked already | |
*/ | |
function updateCheckboxes() { | |
radios.unbind('click'); | |
radios.filter(':checked').click(function () { | |
$(this).prop('checked', false); | |
}); | |
radios.click(function () { | |
updateCheckboxes(); | |
}); | |
} | |
updateCheckboxes(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment