Handling Radio Button using Jquery

by Manigandan 2011-06-08 12:36:47

Radio Button:







Handling change event for Radio buttons:
Click event can be handled similarly. ID can not be used here because Radio buttons are used for single selection from a group where all input fields of group should have same name.


$("input[@name='rdio']").change(function(){
if ($("input[@name='rdio']:checked").val() == 'a')
// Code for handling value 'a'
else if ($("input[@name='rdio']:checked").val() == 'b')
// Code for handling value 'b'
else
// Code for handling 'c'
});

Tagged in:

1331
like
0
dislike
0
mail
flag

You must LOGIN to add comments