[development] Issues with selecting radio buttons with JQuery

Dan Robinson dan at drob.org
Mon Jul 21 20:10:41 UTC 2008


Thanks everyone! - answering all in one to save bits.

Earl -
> I would recommend setting up a #process so that you can use your own 
> version of expand_radios() -- this will let you set things like the 
> #name and #id of each individual radio option individually. That could 
> allow you to much more easily deal with some of this oddness.

Interesting - I'm not sure I completely understand how this works - but 
I will study up.

Moshe -

> please add your review and support to http://drupal.org/node/215301.
> You might learn something helpful from og_access.js in HEAD which does
> some radio button trickery. for example,
>
> $("input[@name='og_visibility']:nth(1)").removeAttr('disabled');
I would like to help here - I actually looked through this yesterday but 
couldn't get the patch to work on D6 - so headed in another direction.  
I'm not working on D7 right now so I'm not sure how to review it - if a 
patch for D6 appears I could jump on that.

Henrique -
> This should do the trick:
>
> $("input[name='Qualifyers[CitizenQ]'][value=no]")
>
> henrique
>   
yeah baby! - that worked - not sure why the escape didn't - but maybe 
I'll figure that out later - thanks!

Dan

> Folks,
>
> Help appreciated -
>
> I'm building a node form where the form will reveal/hide portions
> depending on the users choices.  To do this I'm using jQuery to
> manipulate the DOM.  I'm having a lot of issues with the radio buttons.
>
> What I want to do is have a message pop up if the user selects a
> particular radio button (in this case a "no" choice of a "Yes/No"
> "set").  For this to work I need to attach an "onClick" handle to the
> "no" radio button and when the user clicks evaluate and display the
> message.  Because of a series of interrelated issues I've tried a number
> of approaches.  The one I'm working on now is:



More information about the development mailing list