It would help to see a specific example, or link to an example.  My
immediate response would be to make sure you can select each group
individually, by wrapping it with a div or something and selecting the div,
not all the radio buttons at once.  that way you can handle each group one
at a time and append the message one at a time as well.

eg

<div class="myRadioGroup">
<input />
<input />
..etc
<p class='MyRadioGroupMessage'></p>
</div>


<div class="myRadioGroup">
<input />
<input />
..etc
<p class='MyRadioGroupMessage'></p>
</div>

//select all the 'groups'
$('div.myRadioGroups').each(fucntion(){
    //make sure at least one is selected
    if( ! $('input:radio:selected', this).length > 0){
      //write a message
      $('p.message', this).text("Please select at least one!");
    }
});

Thatcher
On Wed, Oct 22, 2008 at 3:57 PM, Steve <[EMAIL PROTECTED]> wrote:

>
> Hi Everyone,
>
> I'm new at this and can't figure out how to use the $.each properly.
> Let me try to explain more about my Quiz project:
>
> 1. I have a dynamic set of Radio Buttons that are grouped.
> 2. I want to validate that at least 1 is checked per group.
> 3. If a radio button is not checked in a group, i want to display a
> message under that radio buttons that says "please choose".
>
> So i think i'm pretty close, here's my approach please chime and help
> if you can:
> 1. get all Radio Buttons into a jQuery object collection.
> 2. Loop through the Radio Buttons, get the Group Name's and put them
> in an Array.
> 3. Another Loop checking if the Group has a Radio Button Checked.
> 4. If none are checked then I append an asterisk *
>
> My problem is it appends it to all the Radio Buttons.
>
> Thanks!
>
>
>
>


-- 
Christopher Thatcher

Reply via email to