I didn’t dismiss what you said, but isn’t the problem with that
pattern that if I have other radio button sets on the same page it’s
going to pull those back at the same time? And that means I'm going to
have to look at the name of each item and decide if it’s part of this
set of radio buttons or another set of radio buttons?

The way I see it if I want separately selectable items, I'd be using
Check Boxes. The fact that I'm using a Radio buttons is that I want
them to operate as a group and I want to process them as an array. In
standard onclick processing, you add an onclick to each type=”radio”
and in the function run through the array looking for the selected
item, and return the value.

What I want to avoid doing if possible is avoid writing code that is
dependent upon knowing the names used in form since I want to reuse
the code as needed.

It seems such as obvious thing to do I’m convinced I’m going about it
the wrong way!

On Mar 30, 2:23 pm, Walter Lee Davis <wa...@wdstudio.com> wrote:
> It's a prototype enumerable if you follow the pattern I put forward --  
> much better than a vanilla array!
>
> $('parentElement').select('input[type="checkbox"]').each(function(elm){
>         elm.checked = false;
>         if (foo == bar) elm.checked = 'checked';
>
> });
>
> Walter
>
> On Mar 30, 2009, at 9:17 AM, simon.murgatr...@googlemail.com wrote:
>
>
>
>
>
> > That’s the only way I’ve been able to make it work too, but then it
> > leaves me the problem of unselecting the radio boxes manually, a task
> > made harder because it’s no longer an array. The only way I’ve been
> > able to make this work the way I wanted was to use an old style
> > onclick event which doesn’t somehow seem right anymore!
>
> > I suppose another way might be to monitor the whole form for a change
> > and pick it up that way.
>
> > Thanks for the help though.
>
> > Simon- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to