Reputation: 68740
HTML:
form
input:radio 1
input:radio 2
input:radio 3
If one of these is clicked, I'd like to disable the rest. I think siblings selector will be used here but I can't figure out how.
Thanks for your help!
Upvotes: 1
Views: 2066
Reputation: 4771
I think you're trying to disable the others, and for that you need to set the disabled=disabled attribute of the radio input.
$("input:radio").click(function() {
$(this).siblings("input:radio").attr("disabled","disabled");
});
Example Here: http://jsbin.com/oquse/2 View/Edit Code Here: http://jsbin.com/oquse/2/edit
Upvotes: 3
Reputation: 3126
you can use simple javascript + HTML dom for doing this.
radio button events: http://www.hscripts.com/tutorials/javascript/dom/radio-events.php
use a javascript function to be activated on onClick event
Upvotes: 0