http://docs.jquery.com/Selectors/attributeContains#attributevalue
$("input[id*='other']").bind(evt, function(){ alert('This should get called when you click on any radio if it's id contains other') if ($(this).attr('checked') == 'checked' && $(this).val() == 'other') { // not sure how the rest of your forms look like, this probably needs adapting $("#sample_other").show(); $("#edit-sample-other-wrapper").hide(); $(this).parents('div:eq(2)').find('.description').hide(); } else { // not sure how the rest of your forms look like, this probably needs adapting $("#sample_other").hide(); $("#edit-sample-other-wrapper").show(); $(this).parents('div:eq(3)').find('.description').show(); } }); On Jan 16, 11:00 am, "kat...@googlemail.com" <k.bou...@nhm.ac.uk> wrote: > Sure, but I was hoping for a generic kind of answer like > if input=other than ... > Form code is generated by the drupal Form API > [code] > <div class="form-item"> > <div class="form-radios"> > <div class="form-item" id="edit-sample-garden-wrapper"> > <label class="option"><input type="radio" id="edit-sample-garden" > name="samplte" value="garden" class="form-radio" /> a. Garden</ > label> > </div> > > <div class="form-item" id="edit-sample-parkland-wrapper"> > <label class="option"><input type="radio" id="edit-sample-parkland" > name="sample_site" value="parkland" class="form-radio" /> b. > Parkland</label> > </div> > <div class="form-item" id="edit-sample-other-wrapper"> > <label class="option"><input type="radio" id="edit-sample-other" > name="sample" value="other" class="form-radio" /> j. Other</label> > </div> > </div> > <div class="description">Choose one of the above.</div> > </div> > <div id="sample_other"><label>j. Other <input id="sample_other_text" > name="sample_other_text" type="text" value=""/></label></div><div > class="form-item"> > [/code] > > On Jan 16, 12:02 am, Dave Methvin <dave.meth...@gmail.com> wrote: > > > > > Can you post the markup for one of the groups? You can probably use > > that to your advantage.