I have few selectOneRadio, and i want to check if any of thoose radio groups(in each group must be select 1 radio) is empty i need to know which exactly group is empty. How to check it by jquery?
Asked
Active
Viewed 42 times
0
-
possible duplicate with http://stackoverflow.com/questions/426258/how-do-i-check-a-checkbox-with-jquery – setec Feb 21 '14 at 09:02
-
I dont know how to create selector to find groups of radios for example. I was trying $(input[type=radio]).each(...) and i was checking is there any checked value, but it dont work for example when there are two SelectOneRadio on one page. This selector should be resistant to amount of groups of radios/checkboxes becasue i want to use it on few pages – user2771738 Feb 21 '14 at 09:08
1 Answers
0
Retrieve the element or container of the checkboxes group and use the function find()
to find the checkboxes element, example:
$(this).parent().find('input:checkbox').attr('checked', 'checked');

Saurabh
- 1,007
- 2
- 10
- 24

user3111116
- 1
- 1
-
what about radios? When i am using primefaces SelectOneMenu or h:SelectOneMenu ? – user2771738 Feb 21 '14 at 09:32